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 / viki
SELECT PRODUCTNAME FROM PRODUCT WHERE COST <> max(COST)
AND PRODUCTNAME=
(SELECT PRODUCTNAME FROM PRODUCT WHERE COST =
(SELECT COST FROM PRODUCT
ORDER BY COST DESC
FETCH FIRST TWO ROWS ONLY))
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are bind parameters in db2?
How do I delete a table in db2?
What is consistency token in db2?
What is ibm db2 connect?
What is blu acceleration in db2?
What is the role of union all and union
How to check sequence on a table in db2?
What's The Error Code For Unique Index Voilation?
What is copy pending status in db2?
Mention the length of physical storage of the given data types of db2 – date, timestamp, time
How do I connect my db2 database to ibm?
How do I delete a column in db2?
How to find the maximum value in a column in the db2 database?
What is page size in db2?
What is a bind in db2?