• elee1969 (7/3/2013)


    manikanta1207 (7/3/2013)


    what is the query to select nth highest salary of emp table

    select MAX(Salary) from Employee;

    this really sounds like homework....

    anyway,

    the nth highest , ie the second or third, requires the use if a subquery and row_number, or nested top X queries with opposite ORDER BY commands.

    SELECT * FROM (select row_number() over(partition by order by.....) myAlais Where RW = 3

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!