I am facing a wierd problem where the same query is returning different results.
My query is:
SELECT * FROM TX_HISTORY WHERE acct = 7 AND ROWNUM
What is happening is that I know that for this account there are more than 100 records in tx_history. I want to get the first 100 records based on the processing date. My data for this account is I have records from 2004 till 2011
The problem is sometimes it correctly shows the 100 records starting 2004 - but sometimes it shows me 100 records starting 2005
I read that this can be solved by:
SELECT * FROM (select * from TX_HISTORY WHERE acct = 7 ORDER BY acct,processing_date) where rownum
so in my earlier query is it that the: 1> My understanding is that the order by is being applied after the rownum <= 100 and the results returned by oracle are in a random order on which row num is filtering
Though what is not understood why the results would vary Thanks, ~akila