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

what is foreign key? : Sql dba

1059


Can we debug stored procedure?

1031


What is the difference between delete, truncate and drop command?

1155


how to include numeric values in sql statements? : Sql dba

1103


What can sql server reporting services do?

1114


what is the difference between delete and truncate commands? : Sql dba

1071


what is a composite key ? : Sql dba

1066


What are schema-level triggers?

1105


What is the need of merge statement?

1039


What will you get by the cursor attribute sql%rowcount?

1042


What is graph sql?

996


how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba

1009


Is microsoft sql free?

1106


What is the order of sql select?

1041


what is the maximum length of a table name, database name, and fieldname in mysql? : Sql dba

1131