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
How many types of page locks can be held in db2?
What is the picture clause of null indicator variable?
what is diffrence b/w file-aid tool and file-aid utility???
Mention the different locking levels that are available in db2.
Where can you declare a cursor in a cobol-db2 program?
Hello All, We have requirment to Replace BMC Db2 Load product thru CA FAST LOADPlus product. Do anyone have JCL to for FAST LOADPLUS and what all are thing need to take in consideration.
is it compulsory commitment control in journal?
Hi, i would like to start a new carrier in DB2 DBA.Which and what all step should i have to take..?
What is the purpose of using commit?
What are foreign keys in db2?
Comment whether the cursor is closed during commit or not.
Suppose pgm A calling Pgm B .Pgm B has some Db2 program. at the time of compilation should plan and package will be created for both A and B or only B? What is the concept?
What is precompiler in db2?
How to check table size in db2 sap?
What are catalog tables in db2?