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
Which are the db2 tools to protect integrity of the database?
What do you mean by rollback?
Is schema the same as database?
What is catalog database in db2?
What is runstats utility in db2?
How can you count the number of rows from a table tab?
How does a cursor work?
What are the contents of a dclmgen?
How to find the maximum value in a column in the db2 database?
what is a corelated subquerry?
Are views updateable?
How do you simulate the explain of an embedded sql statement in spufi/qmf?
How do I add a column in db2?
Mention the location where the output received from explain statement is stored.
What are the 2 sqlcodes that are returned?