Begin;
update tb1 set c1=,c2=,c3=, … where id=** and c1>* and …;
update tb1 set c1=,c2=,c3=, … where id=** and c1>* and …;
update tb1 set c1=,c2=,c3=, … where id=** and c1>* and …;
update tb1 set c1=,c2=,c3=, … where id=** and c1>* and …;
…
update tb1 set c1=,c2=,c3=, … where id=** and c1>* and …;
update tb1 set c1=,c2=,c3=, … where id=** and c1>* and …;
update tb1 set c1=,c2=,c3=, … where id=** and c1>* and …;
END;
如果每一条更新语句中,c1,c2,c3列的值更新都相同的情况下,可以考虑用如下的语句:
update tb1 set tb.c1=,c2=,c3=
where (tb1的主键字段列表) in (
select tb1的主键字段列表 from
tb1 where (id=** and c1>* and …) or()/这里就是把各条语句的条件通过or连接起来/
)