Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How many times can we commit in a loop?

1012


Is primary key clustered index?

945


What is pl/sql table? Why it is used?

1031


what are ddl statements in mysql? : Sql dba

1192


What is a data definition language?

1105


How do I count rows in sql query?

986


Is sql a programming?

970


What is schema in sql?

943


explain what is mysql? : Sql dba

1078


What is difference between hql and sql?

1070


What are the dml statements?

1141


What are stuff and replace function?

1075


What is compound trigger?

1032


How do you rename a table in sql?

1102


what is the difference between primary key and unique key? : Sql dba

1034