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 do I add a column in db2?
What are bind parameters in db2?
How does a cursor work?
What is copy pending and check pending in db2?
How to get the ddl of a table in db2?
Is the primary key a clustered index?
Which isolation level provides highest data integrity?
What is iseries database?
How to access db2 tables in mainframe?
What is the difference between dbm cfg and db cfg file in db2 ?
What is the function of logging in the db2 database?
What is coalesce in db2?
i tried to copy some records from microsoft excel to as-400 physical file through "Bosanova" emulation. Out of 14000 records only 12000 records copies and subsequently programe started to hang. Then, i closed the program forcefully. I did' under stand the problem. Also when i try to compile the physical file it is showing as "The file in use". How to overcome this problem?
What is a trigger in the db2 database?
What is image copy in db2?