how to get second highest salary in SQL(as/4000

Answer Posted / selvaraj v , anna univ coe

SELECT * FROM Employee e
WHERE 2=(SELECT COUNT(DISTINCT Salary) FROM Employee x
WHERE x.Salary >= e.Salary);

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why truncate is used in sql?

531


Can function return multiple values in sql?

533


what is the difference between union and union all? : Sql dba

547


What are the most important characteristics of pl/sql?

578


Is inner join same as self join?

580






what is a view? : Sql dba

636


What is sqlcommand?

556


what is a foreign key ? : Sql dba

609


What is the usage of the distinct keyword?

690


Is sql a backend?

549


How you improve the performance of sql*loader? : aql loader

580


What are field types?

537


What does over partition by mean in sql?

533


How do I view stored procedures?

543


Is sql difficult?

745