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...

how to find the second highest salary from emp table?

Answer Posted / subash pandey

SELECT salary
FROM employee e
WHERE n = (
SELECT count( * )
FROM employee
WHERE salary > e.salary )

n=1 or 2 or 3 n is level which level max salary you want
i test this it proper work

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is delete command in sql?

1110


When is the update_statistics command used?

1111


Explain commit, rollback and savepoint.

994


GLOBAL TEMPORARY TABLE over Views in advantages insolving mutating error?

3044


How does sql store data?

903


Explain ddl statements in pl/sql?

1009


What are the different types of sql commands?

1123


What is a temporal table?

927


What is the use of <> sql?

976


Is a secondary key the same as a foreign key?

1034


What is data modelling in sql?

1014


What is synonyms?

1055


Can we write ddl statements in functions?

1112


What is foreign key sql?

985


Why is a trigger used?

937