duanboxue3422 2012-06-15 09:08
浏览 15
已采纳

从mysql数据库中删除复杂的值

My table structure in the database;

Table "System_t"

id         |    Owner     |    System
===========================================
1          |    Joe       |    Registration
           |              |    Event             //contains new line
           |              |    Aims
-------------------------------------------
2          |    Rose      |    Ticket
           |              |    Elearning

NOTE : The data field "System" were saved from a Textarea box.

My problem is how am I going to delete only the "Event" data from the field "System"?

My table should be look like this when it is deleted;

id         |    Owner     |    System
===========================================
1          |    Joe       |    Registration
           |              |    Aims
-------------------------------------------
2          |    Rose      |    Ticket
           |              |    Elearning 

Any idea how to do it without changing the table structure?

  • 写回答

6条回答 默认 最新

  • donglei2022 2012-06-15 09:16
    关注

    An UPDATE statement with a REPLACE should be better in this case.

    Look at this post, it might help you understand what I'm talking about :

    Deleting part of a string in MYSQL

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 Python报错怎么解决
  • ¥15 simulink如何调用DLL文件
  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。
  • ¥15 livecharts wpf piechart 属性
  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题