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 the uses of db2 optimizer?
How to create backup table in db2?
What is cursor in dbms?
What is a collection in db2?
before altering a table is it necessary to lock ? if lock what is it ? how to do ? ifi want to lock a table what is that command ?
Is schema the same as database?
What is a db2 package?
What is explain in db2?
What are concurrency issues?
Is db2 relational database?
Give the name of some fields form sqlca.
What is the latest version of ibm db2?
What is db2 stogroup?
What is the default page size of buffer pools?
What is database manager in db2?