Oracle return the first row, not returning the first row I have this query :

select (quarter_1 + quarter_2 + quarter_3 + quarter_4) as total 
from budget where as_of_dt &lt; to_date('2016-06-28', 'yyyy-MM-dd') 
order by as_of_dt desc;


Which returns bunch of numbers such as :



My requirement is to always capture the first number, so when I try to do that :

select * from (
  select (quarter_1 + quarter_2 + quarter_3 + quarter_4) as total 
  from budget where as_of_dt &lt; to_date('2016-05-16', 'yyyy-MM-dd') 
  order by as_of_dt desc
) WHERE ROWNUM = 1


I get this result :



Which is why I m puzzled about this, why is that I m getting the second row instead of the first one? What am I doing wrong here?

Update including as_of_dt in result for first query:
The answer is right there, in the data.  (I assume that the time part is 00:00:00 in all of them):

The order by has ties. There is not one "first row" but 3 of them. 

So, when the 2nd query restricts the result to one row, one of the 3 is - arbitrarily - chosen. It may not be the same row chosen the next time you run the same query!