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

Is sql injection illegal?

1082


Why does sql need a server?

1083


What are packages in pl sql and also explain its advantages?

1125


what are the differences among rownum, rank and dense_rank? : Sql dba

1087


What are the benefits of pl/sql packages?

1160


how many triggers are allowed in mysql table? : Sql dba

1107


What are sql procedures?

1085


What is crud stand for?

1048


How do I upgrade sql?

1051


Explain sql data types?

1145


What does where 1/2 mean in sql?

1145


What is sql character function?

1151


What is character functions?

1116


How much ram can sql express use?

1041


give the syntax of grant and revoke commands? : Sql dba

1218