I have a table(product),It contain fields(productname,cost).
I want to retrieve the product name ,which cost is second
maximum in the table?

Answer Posted / ananth

We can also use correlated subquery for this..

Select product from product a where 1 =
(select count(*) from product b where a.cost < b.cost);

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sqlca?

705


List some fields from sqlca?

682


What is role in db2?

692


what is the responsibility of the construction superintendent

1746


What is db2 bind process?

829






How to create backup table in db2?

742


Why cursor is used in db2?

669


How do I delete a column in db2?

756


What is cloudant database?

720


Who uses db2?

659


Mention the location where the output received from explain statement is stored.

716


What is node in db2?

692


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

324


Explain about dbrm.

684


Which isolation level provides highest data integrity?

675