title: Oracle SQL last n records
body: <p>i have read tons of articles regarding last n records in Oracle SQL by using rownum functionality, but on my case it does not give me the correct rows.</p>
  
  <p>I have 3 columns in my table: 1) message (varchar), mes_date (date) and mes_time (varchar2).</p>
  
  <p>Inside lets say there is 3 records:</p>
  
  <pre><code>Hello world | 20-OCT-14 | 23:50
  World Hello | 21-OCT-14 | 02:32
  Hello Hello | 20-OCT-14 | 23:52
  </code></pre>
  
  <p>I want to get the last 2 records ordered by its date and time (first row the oldest, and second the newest date/time)</p>
  
  <p>i am using this query:</p>
  
  <pre><code>SELECT * 
    FROM (SELECT message 
            FROM messages 
           ORDER 
              BY MES_DATE, MES_TIME DESC
         ) 
    WHERE ROWNUM &lt;= 2 ORDER BY ROWNUM DESC;
  </code></pre>
  
  <p>Instead of getting row #3 as first and as second row #2 i get row #1 and then row #3</p>
  
  <p>What should i do to get the older dates/times on top follow by the newest? </p>