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

Discuss about db2 bind?

0 Answers  


how will you retrieve first record in table

1 Answers   UST,


When one binds a PACKAGE ( of a plan ) what package information is stored and where it is stored?

3 Answers  


What is the maximum length of a column name in DB2? 18 or 30 or anything other than these?

4 Answers  


Is it possible to alter a table – for example adding a column, when another user is accessing or updating some columns?

0 Answers  


before altering a table is it necessary to lock ? if lock what is it ? how to do ? ifi want to lock a table what is that command ?

0 Answers   IBM,


what is different three logs in DB2?

1 Answers   Syntel,


What is the physical storage length of the data types: date, time, timestamp in the db2 database?

0 Answers  


How do I delete a column in db2?

0 Answers  


Hi Dude,this is Ram.could any one tell me aboue CURRENT OF clause in DB2. Thanks in advance.......

2 Answers  


Suppose I have a program which uses a dynamic SQL and it has been performing well till now. Off late, I find that the performance has deteriorated. What happened?

1 Answers  


What information can you find in SYSIBM.SYSLINKS table?

1 Answers   TCS,


Categories