how can we find nth max salary from A table

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I connect my db2 database to ibm?

602


List down the types of triggers in the db2 database?

592


How can you count the number of rows from a table tab?

638


What is copy pending and check pending in db2?

578


What is a cursor in programming?

596






What is load utility in db2?

668


What is concurrency?

711


How to test SQL -911 error while developing COB-DB2 program

6720


What is reorg?

619


Can you tell me how can you find out the # of rows updated after an update statement?

612


What is the physical storage length of the data types date, time, and timestamp?

611


What is the syntax for FETCH in DB2 ?

675


What is the use of commit in db2?

635


How can you classify the locks in db2?

636


What is db2 and what is the use of db2 optimizer?

654