select * from ( select ename,sal,rownum rn from emp where rownum <=9) s where s.rn >= 6;--下面的资料你也可以学习下 --http://database.51cto.com/art/201106/270156.htm
rownum是一个伪列,不能使用>=,只能<=.但可以变化一下:select * from (select ename, sal, rownum as rn from emp) where rn >=6 and rownum <=9;
select * from (
select ename,sal,rownum rn from emp
where rownum <=9) s where s.rn >= 6;--下面的资料你也可以学习下
--http://database.51cto.com/art/201106/270156.htm
(select ename, sal, rownum as rn from emp)
where rn >=6 and rownum <=9;
select * from (select ename,sal,rownum r from emp) where r between 6 and 9
应注意区分与rowid的用法。网上可以搜一下,解释很详细