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 / s. syam sundar

1.SELECT LEVEL,MAX(SAL) FROM EMP WHERE LEVEL = 2 CONNECT BY
PRIOR SAL >SAL GROUP BY LEVEL
2.SELECT SAL FROM (SELECT SAL FROM EMP ORDER BY SAL DESC)
WHERE ROWNUM <3
MINUS
SELECT SAL FROM (SELECT SAL FROM EMP ORDER BY SAL DESC)
WHERE ROWNUM = 1
3.SELECT MAX(SAL) FROM EMP WHERE SAL <> (SELECT MAX(SAL)
FROM EMP)

regards
syam sundaar

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to write date and time literals? : Sql dba

1010


Can function return multiple values in sql?

1098


Why function is used in sql?

992


How many types of sql are there?

1045


What is sql*loader and what is it used for? : aql loader

1249


What is the difference between drop and truncate commands?

1110


How to write a query to show the details of a student from students table whose

1061


how do you login to mysql using unix shell? : Sql dba

1125


When are we going to use truncate and delete?

1022


What are inbuilt functions in sql?

1107


What are sql data types?

1072


Why cannot I use bind variables in ddl/scl statements in dynamic sql?

1261


what is the difference between cluster and non cluster index? : Sql dba

1077


Where the sql database files are stored?

1074


Can you select everything, but 1 or 2 fields, without writer's cramp?

1037