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 db2 bind?
What is the advantage in De-normalizing tables in DB2?
How can you find out the # of rows updated after an update statement?
What is an instance in db2?
What is package in db2 mainframe?
Define sqlca.
What is db2 plan table?
Mention some fields that are a part of sqlca.
What is catalog database in db2?
Why do we need reorg in db2?
List out the buffer pools in db2
What is the syntax for FETCH in DB2 ?
How to find schema of a table in db2?
What is the latest version of ibm db2?
What language is db2 written in?