我想让表中的用户编号前加上字符串page-,期初我是这样写的
update t_wh_user_all set user_code=’page-‘+user_code where 1=1;
用 + 拼接往往是不对的,运行会报错误
正确的sql应该写成这个
update t_wh_user_all set user_code=CONCAT(‘page-‘,user_code) where 1=1;
如果你想在后面追加字符串可以改为
update t_wh_user_all set user_code=CONCAT(user_code,’page-‘) where 1=1;