posted 20 years ago
Hm.. i try to make it more clear
in oracle,if i wrote:
select * from pOrder where .... and rownum <=100 order by createDate
it will join all the condition inside "..." , assign row number to it (base on the nature sorting), filter out all rownum >100 records, and finally sort it by date.
but what i need is:
join all the condition(except rownum<=100), sort it by date, assign rownum base on the date order, then filter out rownum > 100 and return
i think that this query will give me what i want:
select * from ( select * from pOrder where ... order by date ) where rownum<=100
but im worrying the performance as im simplified the query example here, the real one had joined several tables and each table have more than 1M rows..
Any Idea?
Lester