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 can you save or place your msg in a table?

953


How do you use join?

887


What is the difference between numeric and autonumber?

939


Which is the correct statement about truncate and delete?

1034


When should I use nosql database?

944


what is a database transaction? : Sql dba

1106


What is the difference between clustered and non-clustered index in sql?

957


Why do we use %rowtype & %type in plsql?

992


What are the key differences between SQL and PL SQL?

1147


Why function is used in sql?

878


when is the use of update_statistics command? : Sql dba

969


What is a common use of group by in sql?

995


How do you rename a table in sql?

1028


How do I remove sql developer from windows 10?

1012


What is nosql example?

968