当前位置:Gxlcms > 数据库问题 > mysql下sql语句 update 字段=字段+字符串

mysql下sql语句 update 字段=字段+字符串

时间:2021-07-01 10:21:17 帮助过:32人阅读

原文:mysql下sql语句 update 字段=字段+字符串

mysql下sql语句令某字段值等于原值加上一个字符串

 

update 表明 SET 字段= ‘feifei‘ || 字段; (postgreSQL 用 || 来连贯字符串)

  MySQL连贯字符串不能利用加号(+),而利用concat。

  比方在aa表的name字段前加字符‘x‘,利用:

  update aa set name=concat(‘x‘,name)

mysql下sql语句 update 字段=字段+字符串

标签:res   www.   www   update   .com   mysq   字段   html   href   

人气教程排行