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 / mohammed irfan

SELECT sal1 "salary"
FROM (SELECT ROWNUM rownum1 ,sal1
FROM (SELECT sal sal1
FROM emp
ORDER BY sal DESC
)
)
WHERE rownum1=:p_highest;

Note:- 'p_highest' here we can give the number as we want
to display the highest salary.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are secondary keys?

1034


What are records give examples?

1055


what is the difference between truncate and delete statement? : Transact sql

1122


How many clustered indexes can be created on a table?

1126


How many triggers can be applied on a table?

989


Why is %isopen always false for an implicit cursor?

1153


How many sectors are in a partition?

1120


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

1080


Name three sql operations that perform a sort.

1066


What is where clause in sql?

1088


What is t-sql? : Transact sql

1042


What is sql select statement?

1088


What is a pl/sql block?

1331


What is recursive join in sql?

1070


what is online transaction processing (oltp)? : Sql dba

1040