oracle先查询再更改,Oracle更新查询出来的结果,先select再update

90 阅读1分钟

方式有很多种,推荐比较简单一种

用同一个表的查询结果作为条件

update student set status = 2 
where 
studentid in
( select studentid from student where studentid<10 and status=0 order by studentid asc limit 0,1)

如果不行,点击看更多方式