Hi,
I want to find the first record created after a certain date. I use rownum, but I have always understood that is generated after the execution of a query.
The following sql gives me the correct results... but I am uncertain whether its
guaranteed to work:
select *
from mytable
where mydate > to_date('01-01-2011','DD-MM-YYYY')
and rownum = 1
order by mydate
or should I use
select *
from (
select *
from mytable
where mydate > to_date('01-01-2011','DD-MM-YYYY')
order by mydate )
where rownum = 1
Many thanks in advance!
Edit: My db version is 10.2.0.4.0