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
How would the varchar column remarks defined?
Why select is not preferred in embedded sql programs?
Explain the benefits you can get from mainframe connect?
How to test SQL -911 error while developing COB-DB2 program
What is meant by dclgen?
Who uses db2?
What is a db2 table?
Define predicate?
What is multi row fetch in db2?
How to rename a table in DB2 ?
List out the buffer pools in db2
What language is db2 written in?
How is the value function used?
What is cascading rollback?
What are db2 tables?