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 / siri
select productname from product p where 2=(select count(*) from product q where p.cost<=q.cost)
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is cursor stability in db2?
in my project..TEST is db2 8.1 version In PROD it is 7.1 if i do REORG in TEST.. can I use the same REORG jcl with out modification in PROD region (this is DB2 8.1 )? if not, what modification i need to do in my REORG control card?
What is the difference between dbm cfg and db cfg file in db2 ?
How can you validate Sql errors during cursor operation in db2 pgms and where do you code?
How can deadlocks be resolved?
What is view db2?
What is ibm db2 used for?
What is a db2 package?
How to create backup table in db2?
How can record locking be achieved in those DB2 versions which do not support it?
What is scrollable cursor in db2?
Is db2 relational database?
What is rebind in db2?
Which command is used to connect to a database in DB2 ? Give the Syntax.
Is db2 a mainframe database?