Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is load utility in db2?

1167


Define declaration generator (dclgen).

1097


How is the value function used?

1137


What is the reason behind not using select * in embedded sql programs?

1086


What is the physical storage length of the data types date, time, and timestamp?

1080


What's The Percentage Free Space ?

1209


What is plan in cobol db2?

1114


How does db2 sample database connect?

1012


Define db2 and its databases?

1040


What is a db2 table?

990


If I have a view which is a join of two or more tables, can this view be updateable?

1128


What are the contents of dclgen?

1089


How to check last update on table in db2?

1039


How to get the ddl of a table in db2?

1118


List down the data types in the db2 database.

1097