Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> SQL Q: Ten highest rows

SQL Q: Ten highest rows

From: Djordje Jankovic <djankovic_at_corp.attcanada.ca>
Date: Mon, 19 Jun 2000 14:09:02 -0400
Message-Id: <10533.109737@fatcity.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US