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 findout the 100th maximum salary

Answer Posted / srinu

Hi Jyothi,

The below q uery is suitable for Nth max salary....

SELECT a.sal
FROM emp a
WHERE &N=(SELECT COUNT(DISTINCT b.sal)
FROM emp b
WHERE a.sal<=b.sal);
In the above query u can substitute any value like 1,2,..100 etc instead of &n.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are stored procedures faster than dynamic sql?

1105


Is pl sql still used?

1017


What is record type in pl sql?

1036


What are the two types of cursors in pl sql?

1123


What is the difference between sum and count in sql?

1039


What is meant by user defined function?

1102


Which join is default?

1014


What is the sql case statement?

1055


What is a behavioral trigger?

1024


Can we use update in sql function?

1116


How do I run a sql query?

1082


What is the difference between the implicit and explicit cursors?

1111


Write the order of precedence for validation of a column in a table? I. Done using database triggers. Ii. Done using integarity constraints

1132


Which is better join or subquery?

1190


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

1162