我的数据库中有一个名为“system”的字段,如下所示
系统领域;
registration //This field is part of a table called "system_owner"
elearning //all three value is in one string which each contains "\n"
payment
当我使用此SQL语句删除“elearning”时;
$SQL = "UPDATE system_owner SET system=REPLACE(system,'elearning','')
系统字段变得像这样;
registration
payment
我的问题是如何删除“注册”和“付款”之间的空白区域? 我应该使用什么SQL语句?
我想要的字段的输出
registration
payment
答案 0 :(得分:4)
如果你尝试怎么办?
$SQL = "UPDATE system_owner SET system=REPLACE(system,'elearning\n','')