Write a query to find second highest salary of an employee.

Answer Posted / mubin ahmad

select salary from employee e1 where 2=(select count(*)
from employee e2 where e2.salary>=e1.salary)

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference in execution of triggers and stored procedures?

559


Define overloaded procedure?

616


Explain dml and ddl?

536


What is data profiling in sql?

508


What is database migration?

508






What is a unique key and primary key and foreign key?

560


What is range partitioning?

508


What is difference between hql and native sql?

569


Difference between truncate, delete and drop commands?

551


What is pivot in sql?

505


The in operator may be used if you know the exact value you want to return for at least one of the columns.

550


what is text? : Sql dba

545


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

692


Where is all the data on the internet stored?

546


What is difference between nchar and nvarchar?

534