为什么rownum>10 and rownum<20 不能用
而rownum as aaa 以后, aaa>10 and aaa<20可以用呢!

解决方案 »

  1.   

    你一定是这样的:
    select * from (select rownum as rn,wybsm from zh_sbtyjbda)
    where rn>10 and rn<20我想应该是与rownum是伪列有关系,经过改写后rownum不是作为伪列处理的
      

  2.   

    SELECT * FROM employees
    WHERE ROWNUM > 1;
    The first row fetched is assigned a ROWNUM of 1 and makes the condition false. The
    second row to be fetched is now the first row and is also assigned a ROWNUM of 1
    and makes the condition false. All rows subsequently fail to satisfy the condition, so
    no rows are returned.
      

  3.   

    哪里能找到关于rownum的详细说明?
      

  4.   

    rownum 表示一个语句已操作了多少个纪录。select 语句中,每选出一个记录,rownum加1,update、insert也是一样理解,
    所以不能select * from tablename where rownum > 2,因为选出一个记录后rownum=1,然后去判断where条件,不满足,则退出。