I would like to get the top N rows from an Oracle table sorted by date.
The common way to do this, and this solution returns for every question I could find on SO/google.
Select *
from
(select * from
myTable
ordered by Date desc)
where rownum < N
This solution is in my case impracticable because myTable contains an huge ammount of rows which would
lead to Oracle taking too long to return all rows in the subquery.
Question is, is there a way to limit the number of ORDERED rows returned in the subquery ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…