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 db2 catalog database?

582


by using cursors , we can access particular records from the table based on some condition, i want to delete those selected records, how can we write a query for this in the program?

7506


What is dclgen (declaration generator)?

601


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

688


What is deadlock in db2?

579






How does a cursor work?

554


what is the responsibility of the construction superintendent

1660


List some fields from sqlca?

609


Is schema the same as database?

627


What is the use of predicate?

582


Explain about rct.

646


How can we read records for specific member in CL? AND rpg?

231


What is a db2 collection?

603


Cursors can be declared in both working-storage & procedure division, agreed. But is there any difference? If could you please suggest what is the difference

747


What is temporal table in db2?

601