sql:
update (select n.status n_status from cccccc c, nnnnnnnn n 
    where c.status = 1 and n.status = 1 and c.batch_no = n.batch_no 
    and c.prepare_time < sysdate  order by c.prority desc)
    set n_status = 233333 where rownum <= 100;这条sql语句在oracle9i中可以正常执行,但到了oracle10G中就不能执行提示对视图ora-01732:此视图的数据操纵操纵非法(9i和10G只是在应用中发现,是否其他版本有问题还没测试),但在10g中去掉orader by就没问题了。请教在10g中怎么写sql可正常执行。并orader by!

解决方案 »

  1.   

    update (select n.status n_status from cccccc c, nnnnnnnn n  
        where c.status = 1 and n.status = 1 and c.batch_no = n.batch_no  
        and c.prepare_time  < sysdate  order by c.prority desc) 
        set n_status = 233333;这样呢?
      

  2.   

    能不能想办法在update后的子查询中取出100条记录来更新呢?
      

  3.   

    请教在10g中怎么写sql可正常10g中好像不支持嵌套中并排序