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 load utility in db2?
Define declaration generator (dclgen).
How is the value function used?
What is the reason behind not using select * in embedded sql programs?
What is the physical storage length of the data types date, time, and timestamp?
What's The Percentage Free Space ?
What is plan in cobol db2?
How does db2 sample database connect?
Define db2 and its databases?
What is a db2 table?
If I have a view which is a join of two or more tables, can this view be updateable?
What are the contents of dclgen?
How to check last update on table in db2?
How to get the ddl of a table in db2?
List down the data types in the db2 database.