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

How do I quit sql?

1003


Is pl sql useful?

1037


What is rename in sql?

1014


what is top in tsql? : Transact sql

1169


What is oracle sql called?

972


What is cold data?

1010


how to add a new column to an existing table in mysql? : Sql dba

1111


What is primary key and unique key?

1160


what is a composite key ? : Sql dba

1098


What does trigger mean in psychology?

1008


What is the use of index in sql?

1063


What is posting?

1083


What are the packages in pl sql?

1062


How do I debug a stored procedure?

1161


How can one get sql*loader to commit only at the end of the load file? : aql loader

1112