MySQL 更新字符串(在现有的字符串前或后面添加字符串)
我想让表中的用户编号前加上字符串user-,期初我是这样写的
update t_wh_user_all set user_code='user-'+user_code where 1=1;
用 + 拼接往往是不对的,运行会报以下错误
正确的sql应该写成这个
update t_wh_user_all set user_code=CONCAT('user-',user_code)...
原创
2018-09-16 14:05:07 ·
8537 阅读 ·
0 评论