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

Why having clause is used in sql?

982


Can you do multiple joins in sql?

1054


What is difference between group by and partition by?

1062


Can there be 2 primary keys in a table?

997


What is sqlcontext?

1087


how to use in conditions? : Sql dba

1014


How many functions are there in sql?

1032


how to get a list of all tables in a database? : Sql dba

977


How many types of tables are there?

952


How to call a javascript function from pl sql?

1143


what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba

1040


what is datawarehouse? : Sql dba

1023


what is data control language? : Sql dba

1030


How do I create an index in word?

1035


What is the starting oracle error number? What is meant by forward declaration in functions?

994