how to find the second highest salary from emp table?

Answer Posted / ravi

SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP n salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary

where n is the nth highest salary

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is left join inner or outer?

597


Where do we use pl sql?

561


How much ram can sql express use?

517


What is composite primary key in sql?

532


give the syntax of grant and revoke commands? : Sql dba

625






Can we use insert statement in function?

529


i have some prob lem to tell me about my self in interview first round ...

1715


What does select * from mean in sql?

2022


What is the file extension for sql database?

525


What is a schema sql?

538


What is the full form of sql?

542


What is the use of non clustered index?

540


how many sql ddl commands are supported by 'mysql'? : Sql dba

535


How to rename a column in the output of sql query?

543


What is the benefit of foreign key?

538