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

which operator is used in query for pattern matching? : Sql dba

989


What is Histogram?

1550


Describe different types of general function used in sql?

1020


how is exception handling handled in mysql? : Sql dba

1063


Why we use triggers in mysql?

981


Are stored procedures faster than queries?

930


what are the different functions in sorting an array? : Sql dba

1005


Which is better varchar or nvarchar?

980


Show the two pl/sql cursor exceptions.

1169


What is a schema sql?

1130


Define sql delete statement.

990


Define implicit and explicit cursors.

1129


what happens if null values are involved in expressions? : Sql dba

1030


What does inner join mean?

1146


How does sql store data?

894