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

如题所述

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比较简单而且不同数据库通用。
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答