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 / rajat

SELECT * FROM (
SELECT RANK()OVER( ORDER BY SALARY DESC) NUM, A.* FROM RAJ A)
WHERE NUM=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 are the 'mysql' command line arguments? : Sql dba

1122


What is the difference between row level and statement level trigger?

1006


Why truncate is used in sql?

985


Can we use having without group by in sql?

968


Can we use ddl statements in stored procedure sql server?

992


How do I filter in sql profiler?

988


Which are the different character-manipulation functions in sql?

1042


What does where 1/2 mean in sql?

1053


How do I view tables in mysql?

960


Which is faster subquery or join?

1192


Can a primary key be a foreign key?

1006


What are the different types of tables in sql?

977


Is hadoop a nosql?

987


Why plvtab is considered as the easiest way to access the pl/sql table?

1196


what is self-join? : Sql dba

1132