how to find the second highest salary from emp table?

Answer Posted / esakki

select max(salary) from employee where salary not in (select
top 1 salary from employee order by salary desc )


change 1 to 2,3,4,......like that for 3rd max ,4th max
salary.....

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the authentication modes in sql server? How can it be changed? : Sql dba

703


What is the limitation on the block size of pl/sql?

532


What is difference between primary and secondary key?

519


What is on delete restrict?

544


What are aggregate and scalar functions?

528






What is a dirty read sql?

488


What is the difference between python and sql?

524


Can you sum a count in sql?

563


How many types of indexes are there in sql?

538


what are ddl statements in mysql? : Sql dba

579


What is the main reason behind using an index?

560


what is self-join? : Sql dba

574


How do temporal tables work?

521


Write a unique difference between a function and a stored procedure.

535


how mysql optimizes distinct? : Sql dba

556