執行順序
Oracle會先設置行的rownum,再進行order by
執行順序:rownum > order by
正確的寫法應該是先order by,先包一層查詢,再賦rownum值
select *
from (select rownum rno, t1.*
from (select *
from (select sysdate + level level_ from dual connect by level <= 10) t
order by level_ desc) t1) t2
where t2.rno <= 3
