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

Explain various types of locks in db2?

689


What is dbrm? When it will be created?

594


How to execute stored procedure in db2 command editor?

528


Why select is not preferred in embedded sql programs?

711


What is an instance database?

598






What is the role of union all and union

648


What is collection in db2 bind?

572


List some fields from sqlca?

609


what is db2 restart?

1689


What is host variable in db2 cobol?

600


What is with ur in db2?

753


Explain about dbrm.

607


What are packages in db2?

595


What is reorg?

617


Is db2 a mainframe?

581