rownum是无法直接用于>判断的
可以写成
select * from (select rownum rid,... from tab_name where rownum<60) and rid>30

解决方案 »

  1.   


    select id,employname,rownum from t1 where rownum<(select count(*)-30 from t1)
    minus
    select id,employname,rownum from t1 where rownum<(select count(*)-60 from t1);
      

  2.   

    是写错了,最后的where写成and了
    select * from (select rownum rid,... from tab_name where rownum<60) where rid>30
      

  3.   

    select * from (
                    select rownum num, tablename.* 
                           from tablename
                  )
            where num>=30 and num<=60
      

  4.   

    select id,employname,rownum from t1 where rownum<(select count(*)-39 from t1)
    minus
    select id,employname,rownum from t1 where rownum<(select count(*)-69 from t1);昨天累了回复的数字错误,今天改过来了,ORACLE里是行的,我试过的了!!
      

  5.   

    select * from (select rownum rid,... from tab_name) WHERE RID BETWEEN 30 AND 60;
      

  6.   

    select * from (select rownum num,t.* from table_name t where rownum<=60) where num>=30应该可以的
      

  7.   

    select * from (select rownum row_num,A.* from YourTable a) WHERE row_num BETWEEN 30 AND 60;
      

  8.   

    rowid 不能进行“>”操作,“Between”操作时的下限必须是“1”,而“<”操作则没有限制。