Find out the 3rd highest salary?

Answer Posted / priyanga.g

1) Select MAX(salary) from Programmer where salary not
in(select top 2 salary from Programmer order by salary desc)



2) Select max(salary) from programmer where salary<
(select MAX(salary) from Programmer where salary<(select
MAX(salary) from Programmer))


3) Select MAX(salary) from Programmer e where 2=(select
COUNT(*) from programmer b where b.salary>e.salary )

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is sql open source?

545


What are % type and % rowtype?

576


What does fetching a cursor do?

617


How subquery works in sql?

543


What is a common use of group by in sql?

592






Is it possible for a table to have more than one foreign key?

582


What is a recursive stored procedure?

621


If i can use sys.check_constraints to display my constraints from my database using sql server 2005, how can i display then if i am using sql server 2000????

3550


What is scalar and vector?

532


Is it possible to create the following trigger: before or after update trigger for each row?

722


What is oracle and pl sql?

663


What is $$ in sql?

555


What is use of package in pl sql?

534


What is a table?

569


What is sharding in sql?

566