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 / dinesh m
A)
select productname from product
where cost=(Select max(cost) from product where cost not in
(select max (cost) from product) );
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is nvl in db2?
How do I add a column to a table in db2?
What is the role of union all and union
ther r 2 tables OTTABLE & SALTABLE, add the otamt from OTTABLE to empsal of SALTABLE if eid is matched else add the unmatched from OTTABLE to SALTABLE
How can you count the number of rows from a table tab?
DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?
I have a subprogram B calling from mainprogram A.I have opened a cursor in A ,Can i fetch the same cursor in subprogram B , If yes , Please explain the reason?
How to check table size in db2 sap?
When a COBOL-DB2 program in PRODUCTION is updating main tables and gone for long run, what have to do?
What is table space in db2?
How can you validate Sql errors during cursor operation in db2 pgms and where do you code?
What is page size in db2?
Is it possible to alter a table – for example adding a column, when another user is accessing or updating some columns?
How to check last update on table in db2?
What is the difference between nvl and coalesce?