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

Home -> Community -> Usenet -> c.d.o.misc -> Re: To display 5 Largest values from table

Re: To display 5 Largest values from table

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: 21 Mar 2003 23:39:08 GMT
Message-ID: <b5g7qr$28d417$1@ID-82536.news.dfncis.de>

> i want to display first 3 persons with largest salary

select * from
  (select tbl.*, rank() over(order by salary desc) r from tbl ) where r <=5;

hth
Rene Nyffenegger

-- 
  Projektleitung und Entwicklung in Oracle/C++/C# Projekten
  http://www.adp-gmbh.ch/cv.html
Received on Fri Mar 21 2003 - 17:39:08 CST

Original text of this message

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