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 / pc

select productname from product where cost=(select max(cost) from product where cost<> (select max(cost) from product));

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between db2 and oracle?

761


What is image copy in db2?

649


How to find primary key of a table in db2?

713


What is access path in db2?

639


How do you find the maximum value in a column in db2?

735






Name the lockable units in DB2?

759


What are the full forms of spufi and dclgen and why are they used?

735


Who uses db2?

659


What is the default page size of buffer pools?

739


What is coalesce in db2?

766


Explain about dbrm.

684


What is ibm db2 used for?

697


Mention the way of highlighting as well as putting a cursor to use in a cobol program.

718


Is db2 free?

766


What is the physical storage length of the data types: date, time, timestamp in the db2 database?

760