上次在談前N條記錄取得時
具體SQL如下
SELECT * FROM
( SELECT * FROM
( SELECT * FROM
( SELECT EMPNO
FROM SCOTT
ORDER BY HIREDATE ASC )
WHERE ROWNUM <
ORDER BY HIREDATE DESC )
WHERE ROWNUM <
執行結果
EMPNO ENAME HIREDATE
雖然上面的SQL可以解決這個問題
From:http://tw.wingwit.com/Article/program/Oracle/201311/17697.html