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

What is dynamic SQL?

1 Answers   ADP,


pls tell me abt the normalization five types....

2 Answers  


Is db2 a mainframe?

0 Answers  


what is the total syntax for fetch ? can any one please give me all the details of fetch ? thx

2 Answers   IBM,


Explain about open switch business continuity software?

0 Answers  






wht displays the number of times a query modified ?

2 Answers   TCS,


What is a Cartesian product?

2 Answers  


What is meant by explain?

0 Answers  


What are the various isolation levels possible?

0 Answers  


How to resolve -504 sql code in DB2?

2 Answers   Cap Gemini,


max number of columns in a db2 table?

6 Answers  


What are the rules for db2 programming?

0 Answers  


Categories