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

Home -> Community -> Usenet -> c.d.o.tools -> find the second largest element

find the second largest element

From: Hongjiew <hongjiew_at_aol.com>
Date: 20 Nov 2000 21:45:37 GMT
Message-ID: <20001120164537.17295.00000947@ng-cg1.aol.com>

Dear friend, I like to write a query that will find the largest and the second largest values of a column in a group by setting.

For example,

Table a

id sal
001 1000
001 1000
001 500
002 200
002 400
002 500

...
I want to get
id maxsal secmaxsal
001 1000 1000
002 500 400.

Thanks.

hongjiew_at_aol.com Received on Mon Nov 20 2000 - 15:45:37 CST

Original text of this message

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