Article:
  SQL Data Types
Subject:   how do we find nth highest in SQL
Date:   2004-10-13 04:11:13
From:   sunrek
Response to: how do we find nth highest in SQL

can u please help me
Main Topics Oldest First

Showing messages 1 through 2 of 2.

  • how do we find nth highest in SQL
    2005-10-17 23:31:59  Apurva_Sharma [View]

    Hi,
    Solution to your query.Plz follow steps.

    Steps
    SQL> SET Verify OFF;

    SQL> SELECT min(sal)
    FROM (SELECT sal
    FROM emp
    order by sal desc)
    WHERE rownum<(&nth_heighest+1);
  • how do we find nth highest in SQL
    2004-11-14 21:40:07  Question&answer [View]

    To find the nth highest salary as below

    select max(a.sal) from emp a where &n=(select count(b.sal) from emp b where (a.sal output-
    put the value of n and get the highest salary that u have give the number i;e 4,5,6,10 etc.

    thanx,
    Haribrat