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 / venkat ramana
SELECT PRODUCTNAME
FROM PRODUCT
WHERE COST < (SELECT MAX(COST)FROM PRODUCT)
ORDER BY COST DESC
FETCH FIRST 1 ROW ONLY ;
HOPE THE ABOVE QUERY WILL PROVIDE YOU THE DESIRED RESULT.
| Is This Answer Correct ? | 14 Yes | 2 No |
Post New Answer View All Answers
What is cloudant database?
List out the buffer pools in db2
What is scrollable cursor in db2?
What is the latest version of ibm db2?
How do I delete a table in database?
What r the comman abends in db2, jcl and cobol???????
What does reorg do in db2?
What is an instance in db2?
What is a page in db2?
How do you find the maximum value in a column in db2?
How is a typical db2 batch pgm executed?
How to create db2 table in mainframe?
What is drop table?
what are bind concepts in db2 cobol?
What does db2 blu stand for?