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 is the difference between inner join and left join?

956


What is sap sql anywhere?

1009


What is a natural join sql?

934


What company owns postgresql?

982


Which type of cursor is used to execute the dml statement?

913


how are mysql timestamps seen to a user? : Sql dba

1080


What is the primary key?

907


Does pdo prevent sql injection?

898


Do stored procedures prevent sql injection?

935


column A column b | output 10 7 | 10 5 8 | 8 7 -9 | 7 3 5 | 5 0 6 | 6 Write a sql query to print such output.

7192


What is dml with example?

1035


what are all the different normalizations? : Sql dba

986


Does a primary key have to be a number?

934


What is snowflake sql?

1025


How do I create a sql database?

961