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


Please Help Members By Posting Answers For Below Questions

What is db2 instance?

687


How can you find out the # of rows updated after an update statement?

733


What is ibm db2 client?

597


What is the use of commit in db2?

710


What is the difference between "db2ilist" and "db2 get instance" commands in DB2 Database Server?

826






Is schema the same as database?

718


How to connect to db2 database from windows command line?

651


What is the syntax for seeing the columns and data types of a table in the db2 database?

661


What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?

833


Define db2.

757


How will you return the number of records in table?

595


Can you tell me how can you find out the # of rows updated after an update statement?

709


What are the two types of logging in the db2 database? Explain them.

676


What is db2 catalog database?

659


How do I copy a table in db2?

664