早睡早起,方能养生
Sleep early rise early, way to keep healthy

Mysql将一个字段的值,修改为另外两个字段拼接起来的字符串

super
2023-08-26 20:02
views 648

update template set whole_title = CONCAT(id,'',title) where id > 0;

 

将template表的所有记录的whole_title修改为 id + title拼接起来的字符串,中间不使用任何符号连接。

 

update template set whole_title = CONCAT(id,'',title,'_',en_title) where id > 0;

 

将template表的所有记录的whole_title修改为 id + title + en_title拼接起来的字符串,id与title中间不使用任何符号连接,title与en_title中间使用“_”连接。



分享
0 条讨论
top