Write a query to get 2nd maximum salary in an employee table ?
Answer Posted / anupam274
use AdventureWorks
select * from HumanResources.EmployeePayHistory e where
2 = (select count(distinct Rate) from
HumanResources.EmployeePayHistory where e.Rate<=Rate)
select * from HumanResources.EmployeePayHistory e where
4 >(select count(distinct Rate) from
HumanResources.EmployeePayHistory where e.Rate<=Rate)
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Is sql injection illegal?
Why does sql need a server?
What are packages in pl sql and also explain its advantages?
what are the differences among rownum, rank and dense_rank? : Sql dba
What are the benefits of pl/sql packages?
how many triggers are allowed in mysql table? : Sql dba
What are sql procedures?
What is crud stand for?
How do I upgrade sql?
Explain sql data types?
What does where 1/2 mean in sql?
What is sql character function?
What is character functions?
How much ram can sql express use?
give the syntax of grant and revoke commands? : Sql dba