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

What are the different types of dbms?

1007


What is trigger in sql? Explain

992


why does the selected column have to be in the group by clause or part of an aggregate function? : Sql dba

1103


Do we need commit after truncate?

1072


which tcp/ip port does sql server run on? : Sql dba

1024


What is difference between my sql and sql?

1061


what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba

1002


What is not in sql?

941


How to check if a column is nullable before setting to nullable?

1122


What is serial sql?

969


What are pl/sql cursor exceptions?

1098


what are aggregate and scalar functions? : Sql dba

1053


When is a declare statement required?

1136


What is date functions?

1026


Can a procedure in a package be overloaded?

1043