Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> SQL Q: Ten highest rows
Friends,
A SQL question (not PL/SQL - I know how to do it in PL/SQL, but it is pretty clumsy).
Can you select e.g. ten rows with the highest value of a certain column ?
It is not allowed to put "order by" in a subquery, e.g. :
select val
from (select val from tab order by val)
where rownum < 11),
and rownum is applied before the group by, (e.g.:
select val
from tab
where rownum < 11
order by val
Thanks a lot. Received on Mon Jun 19 2000 - 13:09:02 CDT