我这有条语句
update student set on_class = '*' where  on_class is  null and rownum < 30 ;
我希望按照id顺序进行一步步修改,请问怎么办,
但我这样试了,却不行update student set on_class = '*' where  on_class is  null and rownum < 30  order by id ;谢谢大家

解决方案 »

  1.   


    --只有用In子句了
    update   student   set   on_class   =   '*'   where     on_class   in 
      (select on_class from student where rownum<30 and on_class is null order by id)
      

  2.   

    update语句没有顺序的意义啊!
    你用1楼的速度会慢的
      

  3.   

    1楼的SQL语句有意义吗?你的子查询查找出来的都是一些NULL,然后你用IN子句
    就相当于IN(NULL,NULL....)这还与ID有什么关系啊