I'm not sure that ORACLE had a TOP function. You want to use the TOP-N query.
For example:
select *
from (SELECT *
FROM foo
where foo_id=[number]
order by foo_id desc)
where rownum <= 3
This will give you the three best results (because I order descending in the subquery)
source
share