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 to find primary key of a table in db2?
Explain how can you do the explain of a dynamic sql statement?
What is performance tuning db2?
what are bind concepts in db2 cobol?
List out the data types available.
What is difference between alias and synonym in db2?
What is consistency token in db2?
What are the rules for db2 programming?
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 ?
Why do we need reorg in db2?
What is data manager?
In case if at some point of time db2 is down, would that impact the pre-compilation process of a db2-cobol program?
What are db2 tables?
What are db2 objects?
What is cursor in dbms?