- select a1.*, rownum rn from (select * from emp) a1;
- select * from (select a1.*, rownum rn from (select * from emp) a1) a2
- where where a2.rn>10 and a2.rn<12;
- 上面用到了3次 select 操作,实际上2次就能完成,代码如下:
- select a1.* from ((select ename, sal, rownum rn from emp)a1)
- where a1.rn >8 and a1.rn<10;
- --该片段来自于http://www.codesnippet.cn/detail/1602201614547.html
来源: http://www.codesnippet.cn/detail/1602201614547.html