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 retrieve a second highest salary from a table?
Note:Suppose salaries are in duplicate values
eg:
Name Sal
Malli 60000
Pandi 60000
Rudra 45000
Ravi 45000

Answer Posted / sreeharibabu

SELECT id
FROM (select salary2.*, rownum rnum from
(select * from test ORDER BY id DESC) salary2
where rownum <=2 )
WHERE rnum >= 2;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Could you please provide oca (oracle 10g) dumps for my certification ?

5070


Do stored procedures prevent sql injection?

920


What is left join example?

891


What is nested table in pl sql?

1007


What does varchar include?

908


Which command is used to delete a package?

1092


what are date and time intervals? : Sql dba

998


What language is oracle sql developer?

940


What is the use of prepared statement?

953


Is join and inner join the same?

942


What are all the different normalizations?

972


List the various privileges that a user can grant to another user?

990


How insert into statements in sql?

1011


How to use sql statements in pl/sql?

1055


What is the maximum number of triggers, you can apply on a single table?

946