how can we find nth max salary from A table

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

can all users have the privilage to use the sql statement select * (dml)?

643


What is role in db2?

621


What is the meaning concurrency in the db2 database?

634


What is dclgen (declaration generator)?

603


DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?

2279






What do you mean by cursor?

586


What does runstats do in db2?

607


What are db2 tables?

649


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 ?

1715


Explain about dbrm.

609


What is drop table?

584


What is the difference between "db2ilist" and "db2 get instance" commands in DB2 Database Server?

714


What is the difference between spufi and qmf?

639


Which are the db2 tools to protect integrity of the database?

692


What is view db2?

626