SELECT person, RESULT
  FROM (SELECT person, RESULT,
        ROW_NUMBER ()
           OVER (PARTITION BY person ORDER BY RESULT) RN
       RN = 2;

Mike

On Tue, Nov 11, 2008 at 12:17 PM, Vlad <[EMAIL PROTECTED]> wrote:

>
> If I have a table with two columns Person and Result that has many
> values:-
>
> Person    Result
> Tom        1
> James     1
> Tom        2
> James     4
> Tom        6
> James     5
>
> What query would I use to find the 2nd highest result each of the
> people achieved?
>
> I.e. the result would be
>
> Tom 2
> James 4
>
> TIA
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to