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 cursor stability?

1 Answers  


why we create view.

5 Answers  


Can a primary key have null values? If we try to insert a null value in a primary key column, will it work or give an error code?

6 Answers  


Define check constraint.

0 Answers  


What are concurrency issues?

0 Answers  






What is a thread?

3 Answers  


Define data page.

0 Answers  


When you are working with the project after coding what will u do? Like what type of documents u will prepare? How will u do testing?

2 Answers  


What is QUIESCE?

2 Answers  


Can we use group-by clause in sub-query? If 'yes' means,Will it be executed successfully or else If 'no' means why should we not using that method? Give me your suggestion please....

1 Answers  


What is a base table?

2 Answers  


pls explain the precompilation process of cobol-db2 pgm

3 Answers   HCL, IBM,


Categories