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 / pc
select productname from product where cost=(select max(cost) from product where cost<> (select max(cost) from product));
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is clone table?
Is it possible to alter a table – for example adding a column, when another user is accessing or updating some columns?
Hi Everyone... Under the Logical files, when am working on multiple rec format logical file, I have joined two pf's using the multiple record format logical file concept, but when i run queried the LF only the first mentioned pf records are reflecting and I am not able to see any of the field records specified under the second pf. Kindly let me know whats the reason behind this. Below is the str of LF., R rec PFILE(LOGICAA) CUSTNO CUSTNAME BILL K CUSTNO R rec1 PFILE(LOGICAA1) CUSTNO ADD K CUSTNO .....
How do I connect my db2 database to ibm?
How to find primary key of a table in db2?
What is image copy in db2?
Mention the location where the output received from explain statement is stored.
How to rename a table in DB2 ?
What is consistency token in db2?
Which component is responsible for db2 startup and shutdown?
SQLCODE = -199, ERROR: ILLEGAL USE OF KEYWORD CHAR, TOKEN KEY was expected
What is a trigger in the db2 database?
I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.
How do I delete a table in db2?
What are concurrency issues?