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 explain plan in db2?
What r the comman abends in db2, jcl and cobol???????
can we view the access paths created by dbrm ? how ? thx
What is a bind in db2?
What are db2 tables?
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 ?
How to test SQL -911 error while developing COB-DB2 program
Explain package in db2 and its advantages?
How do we specify index to include or not during bind process.
What is host variable?
How can we read records for specific member in CL? AND rpg?
How do you concatenate the firstname and lastname from emp table to give a complete name?
I HAVE 500 ROW TO UPDATE I WOULD LIKE TO USE ROLLBACK ALONG WITH COMMIT.WHAT IS THE SYNTAX TO CODE COMMIT AND ROLLBACK FOR EVERY 100 ROWS.AND HOW THE CURSOR ROLLBACK TO THE LAST COMMITTING POINT.
What are the prerogatives?
I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.