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 / mr. cooooool
Hi............
SELECT PRODUCTNAME FROM PRODUCT WHERE COST = (SELECT MAX(COST)
FROM PRODUCT WHERE COST > (SELECT MAX(COST) FROM PRODUCT));
THANKS
REGARDS
RAVINDRA BISHT
Is This Answer Correct ? | 13 Yes | 15 No |
Post New Answer View All Answers
Is db2 a database?
What is a db2 collection?
Which are the db2 tools to protect integrity of the database?
How to retrieve rows from a db2 table in embedded sql?
I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.
What is meant by union and union all?
What db2 400?
What is the role of schema in the db2 database?
Is the primary key a clustered index?
When reorg is used?
What are the various isolation levels possible?
What is the default page size of buffer pools?
What is null value in db2?
How to find schema of a table in db2?
How to execute stored procedure in db2 command editor?