如题    update tableA set state=10 where state=0 and rownum<=100
     我现在要更新 前100条数据,但是这100条是无序的,我需要根据一个 时间字段(STIME)进行排序 如何时间                    在线求解!!!

解决方案 »

  1.   

    你的意思是说先按stime排序再更新?
      

  2.   

     如果tableA有主键的话,设为pk_id
    update tableA t
       set state = 10
     where t.state = 0
       and t.pk_id in (                   
                       select pk_id
                         from (select * from tableA order by STIME)
                        where rownum <= 100)