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 the sqlcode -501

13170


What are union and union all?

986


Why cursor is used in db2?

1040


What is sqlca?

1084


Explain the function done by data manager?

1285


Is it possible to create an Instance in DB2 using DB2 Control Center ?

1110


What is the difference between db2 and oracle?

1136


What is the physical storage length of timestamp data type?

1102


DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join. Explain the differences?

2861


What is the max length of sqlca?

1222


Name the various locking levels available?

1101


What is a db2 collection?

1054


What is db2?

1186


Can we delete records from view?

972


What is page size in db2?

984