php mysql中如何往表中追加数据

php mysql中如何往表中追加数据,第1张

update table set field=concat(' ', field, '072110003') where field='072110001'

应该是

update table set field=concat_ws(' ', field, '072110003') where field='072110001'

或者

update table set field=concat(field, ' ', '072110003') where field='072110001'

对于需要一次添加多个值,并且都用' '隔开的话,用第二条语句比较方便。 一次只用一个的话,concat比较简单而且不同数据库通用。

说白了就是追加

后追加

update 表名 set 字段名 = concat(series,",2")

前追加

update 表名 set 字段名 = concat("2,",series)


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/6763343.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-27
下一篇 2023-03-27

发表评论

登录后才能评论

评论列表(0条)

保存