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 / rajasekaran
with e as (select product_name,cost,rank() over(order by
cost desc) as rk from product) select * from e where rk=2;
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
what is the sqlcode -501
What are union and union all?
Why cursor is used in db2?
What is sqlca?
Explain the function done by data manager?
Is it possible to create an Instance in DB2 using DB2 Control Center ?
What is the difference between db2 and oracle?
What is the physical storage length of timestamp data type?
DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?
What is the max length of sqlca?
Name the various locking levels available?
What is a db2 collection?
What is db2?
Can we delete records from view?
What is page size in db2?