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 can we find nth max salary from A table

Answers were Sorted based on User's Feedback



how can we find nth max salary from A table..

Answer / asp

select * from table1 a where (n-1) = (select count(distinct
(sal)) from table1 b where b.sal>a.sal)

Is This Answer Correct ?    15 Yes 5 No

how can we find nth max salary from A table..

Answer / bhaskar reddy

select * from table1 a where(n-1)= (select count(distinct
sal) from table1 b where b.sal>a.sal)

Is This Answer Correct ?    6 Yes 5 No

how can we find nth max salary from A table..

Answer / sivaraman

select * from table1 a where n = (select count(distinct
(sal)) from table1 b where b.sal>a.sal)


n is value of n it should be numeric....

Is This Answer Correct ?    15 Yes 15 No

how can we find nth max salary from A table..

Answer / a

select MAX(Salary) from Employee
WHERE Salary NOT IN (select MAX(Salary) from Employee )

Is This Answer Correct ?    0 Yes 9 No

how can we find nth max salary from A table..

Answer / venkat

select max(sal) from tablename.

Is This Answer Correct ?    7 Yes 51 No

Post New Answer

More DB2 Interview Questions

How to insert more than one record using insert?

7 Answers   Atos Origin, IBM,


what is the sqlcode -501

5 Answers   IBM, Polaris, Zeus,


What is reorg in database?

1 Answers  


When do you use the IMAGECOPY?

4 Answers  


How to check table size in db2 sap?

0 Answers  


select * from orders where odate between '2010-01-01'and '2010-03-31' How do u fetch this into cursor?

2 Answers  


When is the skeleton cursor table created?

1 Answers  


My DB2 program first read the data from a file and then it look into a table with the data it got from the file.If we did not bind the program , should the file read before SQL execution be success??

2 Answers   Xansa,


What is the connection string to connect to the DB2 Database ?

0 Answers   MCN Solutions,


select distinct(empid),distinct(dept),name from EMP will the above query work?

2 Answers   CTS,


How to resolve -803 sql code in DB2?

3 Answers   Cap Gemini,


Mention some fields that are a part of sqlca.

0 Answers  


Categories