title: Oracle query returning differnet results for same set of data
body: <p>I am facing a wierd problem where the same query is returning different results.</p>
  
  <p>My query is:</p>
  
  <pre>SELECT * FROM TX_HISTORY  WHERE acct = 7  AND ROWNUM </pre>
  
  <p>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 </p>
  
  <p>The problem is sometimes it correctly shows the 100 records starting 2004 - but sometimes it shows me 100 records starting 2005 </p>
  
  <p>I read that this can be solved by:</p>
  
  <pre>SELECT * FROM (select * from TX_HISTORY  WHERE acct = 7  ORDER BY acct,processing_date)
  where rownum </pre>
  
  <p>so in my earlier query is it that the:
  1> My understanding is that the order by is being applied after the rownum &lt;= 100 and the results returned by oracle are in a random order on which row num is filtering </p>
  
  <p>Though what is not understood why the results would vary 
  Thanks,
  ~akila</p>