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 / vineeth varghese

(Select product from product where cost = (Select Max (cost) from product where cost not = (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 sqlca?

632


What language is db2 written in?

606


What are the bind parameters ibm db2?

630


Define db2 and its databases?

633


How does cobol compile db2 program?

617






What is isolation level in db2?

588


have 3 tables table1, table2 and table3 which contains employee information. table1 is master table, table2 contains emp details like emp no and so on, table 3 contains emp salary. so if any emp leave company between 25th - 30th of every month it has to get updated in tables. but it is not getting updated. What is the reason.

1255


What is the role of the data page in the db2 database?

595


How to connect to db2 database from windows command line?

572


How do I change the column size in db2?

611


What is database alias db2?

623


before altering a table is it necessary to lock ? if lock what is it ? how to do ? ifi want to lock a table what is that command ?

1720


by using cursors , we can access particular records from the table based on some condition, i want to delete those selected records, how can we write a query for this in the program?

7549


What are the benefits of using the db2 database?

668


What are db2 objects?

649