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 utility for parm lib

2311


Define sqlca.

1056


What is a storage group (stogroup)?

1189


Mention the various locks that are available in db2.

976


How to fetch the last row from the table in SQL (db2)?

1590


Hi, i would like to start a new carrier in DB2 DBA.Which and what all step should i have to take..?

3091


How to create db2 table in mainframe?

1105


What is coalesce in db2?

1058


Why db2 is called db2?

972


Explain the function done by data manager?

1219


What is runstats utility in db2?

963


How many databases can be created inside an instance in db2 ?

981


What is data manager?

995


Give a brief description of db2 isolation levels?

1014


What do you mean by rollback?

932