问题是: 一个表里面,有一万条数据。在表里面有一个属性,列如(temp) 属性。
temp的数据为 1, 2, 3, 4, 这样平均循环。
现在要更新成(temp的数据为 1, 2, 3, 4, 这样平均循环。)数据。。求大侠, 好好想想,,,求求
temp的数据为 1, 2, 3, 4, 这样平均循环。
现在要更新成(temp的数据为 1, 2, 3, 4, 这样平均循环。)数据。。求大侠, 好好想想,,,求求
--用下面这条语句试试看是不是你想要的
update student s set s.studentnum=mod(s.studentnum+3,4)+1;;
我说一下我的吧。。update tables set ='1(是字符串的)' where 条件。(i)
i := i + 1 ;
update tables set ='2' where 条件(i)
i := i + 1 ;
update tables set ='3' where 条件(i)
i := i + 1 ;
因为循环里面有这样的四条更新语句。 所以 条件无法确定用的是 while
update tables set = '1' where (活儿)update tables set ='2' where (活得)update tables set ='3 ' where ....update tables set ="4" where ...
set 字段名 = case when 条件1 then '1' when 条件2 then '2' when 条件3 then '3' when 条件4 then '4' end;