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 / ramesh lavanuru

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 ?    52 Yes 63 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the indexing methods?

1098


Does mysql_real_escape_string prevent sql injection?

993


how would you get the current date in mysql? : Sql dba

1015


How do I view a sql trace file?

1061


Can we insert in sql function?

1142


How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000

2205


Explain autonomous transaction.

1220


tell me about various levels of constraint. : Sql dba

1073


What is sql procedures and functions?

1071


When can we use the where clause and the having clause?

1082


what are the types of join and explain each? : Sql dba

1084


What is the use of function in sql?

1149


What is a table partition?

1205


What's the difference between a primary key and a clustered index?

1024


What does count (*) mean?

983