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

Can we rename a column in the output of sql query?

993


What is an index? What are the types of indexes? How many clustered indexes can be created on a table?

1066


What is the use of stored procedures?

1044


How to test for null values?

1044


What are the two types of exceptions in pl/sql?

1049


How is debugging done?

972


How do I audit the sql sent to the server?

1002


What is a constraint?

1018


What is difference between stored function and application function?

1195


can sql servers linked to other servers like oracle? : Sql dba

1005


Is sql better than excel?

1148


What is database sql?

1042


What does inner join mean?

1160


What is query optimization in sql?

983


Explain the structure of pl/sql in brief.

1090