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 are db2 objects?

641


My sql statement select avg(salary) from emp yields inaccurate results. Why?

643


Mention the various locks that are available in db2.

616


When the like statement is used?

640


Hi Everyone... Under the Logical files, when am working on multiple rec format logical file, I have joined two pf's using the multiple record format logical file concept, but when i run queried the LF only the first mentioned pf records are reflecting and I am not able to see any of the field records specified under the second pf. Kindly let me know whats the reason behind this. Below is the str of LF., R rec PFILE(LOGICAA) CUSTNO CUSTNAME BILL K CUSTNO R rec1 PFILE(LOGICAA1) CUSTNO ADD K CUSTNO .....

1897






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

644


what is diffrence b/w file-aid tool and file-aid utility???

4182


What is the syntax for seeing the columns and data types of a table in the db2 database?

578


List out the buffer pools in db2

632


What is sqlca?

625


What are concurrency issues?

632


What is access path in db2?

565


Explain package in db2 and its advantages?

598


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

234


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?

7518