如果是要所有属相 一起修改,使用存储过程可以实现,再开启事务应该可以: 存储过程中直接使用 update table_name set lunar ='龙' where lunar ='蛇' ; update table_name set lunar ='兔' where lunar ='龙' ; ......... 活在 读取游标,在游标中判断并修改 if(ps_lunar ='蛇' ) then update table_name set lunar ='龙' where ID=ps_id ; end if ; .....
存储过程中直接使用
update table_name set lunar ='龙' where lunar ='蛇' ;
update table_name set lunar ='兔' where lunar ='龙' ;
.........
活在 读取游标,在游标中判断并修改
if(ps_lunar ='蛇' ) then
update table_name set lunar ='龙' where ID=ps_id ;
end if ;
.....