how can we find nth max salary from A table

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the syntax for creating a table in the db2 database?

720


In an sql table that is embedded, what is the procedure to retrieve rows that are part of a db2 table?

725


How would the varchar column remarks defined?

726


Explain db2.

696


What is the difference between dbm cfg and db cfg file in db2 ?

1104






Explain packages.

756


What os does db2 run on?

651


What is consistency token in db2?

749


How can record locking be achieved in those DB2 versions which do not support it?

720


How can the firstname and the lastname from the emp table be concatenated to generate complete names?

845


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

723


What is cascading rollback?

712


What is catalog database in db2?

749


Is it possible using max on a char column?

703


How is a typical db2 batch pgm executed?

720