update 语句常用规则

更新数据表中的字段,并且拼接一个变量

set @i:=1;
update table_users 
SET mobile=CONCAT(mobile,'_', (@i:=@i+1));

更新数据表中的字段,并且拼接常量

update table_users 
SET mobile=CONCAT(mobile,'_', 123);

更新数据库添加条件

update table_users 
SET mobile=CONCAT(mobile,'_', 123) where ID=1223;

猜你喜欢

转载自blog.csdn.net/qq_33382118/article/details/81411029