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
How many times can we commit in a loop?
Is primary key clustered index?
What is pl/sql table? Why it is used?
what are ddl statements in mysql? : Sql dba
What is a data definition language?
How do I count rows in sql query?
Is sql a programming?
What is schema in sql?
explain what is mysql? : Sql dba
What is difference between hql and sql?
What are the dml statements?
What are stuff and replace function?
What is compound trigger?
How do you rename a table in sql?
what is the difference between primary key and unique key? : Sql dba