方式有很多种,推荐比较简单一种
用同一个表的查询结果作为条件
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)
用同一个表的查询结果作为条件
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)