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 get second highest salary in SQL(as/4000

Answer Posted / sreekanth

SELECT MIN(SAL)
FROM(SELECT DISTINCT SAL FROM EMP
ORDER BY SAL DESC)
WHERE ROWNUM <= :N
where n is the nth highest salary.
In most of the answers,our friends have written 'where
rownum=2',but this never retreives a row.

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is sql considered coding?

996


What is using in sql?

1019


What is sql integrity?

1064


Which operator is used in query for pattern matching?

1034


Enlist some predefined exceptions?

998


What is output spooling in sql*plus?

986


How do I run a sql script?

1056


What is difference between procedure and trigger?

919


Can we insert in view in sql?

1004


What is difference between group by and partition by?

978


Explain clause in sql?

962


Why triggers are used?

939


Why do we use triggers?

916


how do you control the max size of a heap table? : Sql dba

924


What is cursor status?

1135