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
Explain various types of locks in db2?
What is dbrm? When it will be created?
How to execute stored procedure in db2 command editor?
Why select is not preferred in embedded sql programs?
What is an instance database?
What is the role of union all and union
What is collection in db2 bind?
List some fields from sqlca?
what is db2 restart?
What is host variable in db2 cobol?
What is with ur in db2?
Explain about dbrm.
What are packages in db2?
What is reorg?
Is db2 a mainframe?