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 / venkat ramana
SELECT PRODUCTNAME
FROM PRODUCT
WHERE COST < (SELECT MAX(COST)FROM PRODUCT)
ORDER BY COST DESC
FETCH FIRST 1 ROW ONLY ;
HOPE THE ABOVE QUERY WILL PROVIDE YOU THE DESIRED RESULT.
| Is This Answer Correct ? | 14 Yes | 2 No |
Post New Answer View All Answers
How will you return the number of records in table?
what is a corelated subquerry?
What is release/acquire in bind?
What is phantom read in db2?
What is query_cache_limit?
How to rename a table in DB2 ?
What is buffer pool in the db2 database?
What is cobol db2?
How to check last update on table in db2?
Give a brief description of db2 isolation levels?
What is the difference between drop table and delete table?
How can you quickly find out the # of rows updated after an update statement?
What is the information associated with sysibm.syslinks table?
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 a page in db2?