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 / mr. cooooool
Hi............
SELECT PRODUCTNAME FROM PRODUCT WHERE COST = (SELECT MAX(COST)
FROM PRODUCT WHERE COST > (SELECT MAX(COST) FROM PRODUCT));
THANKS
REGARDS
RAVINDRA BISHT
| Is This Answer Correct ? | 13 Yes | 15 No |
Post New Answer View All Answers
What is a db2 cursor?
What is db2 and what is the use of db2 optimizer?
How would the varchar column remarks defined?
What are foreign keys in db2?
How do you concatenate the firstname and lastname from emp table to give a complete name?
Highlight all the advantages that are attached to a package.
Why do we need reorg in db2?
Before you give the explain statement, what are the prerogatives?
How to retrieve rows from a db2 table in embedded sql?
What is check constraint in db2?
Are view updateable?
What is the usage of open cursor command?
What is a trigger in the db2 database?
What is db2 instance?
How to find the number of rows in a db2 table?