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 / viki

SELECT PRODUCTNAME FROM PRODUCT WHERE COST <> max(COST)

AND PRODUCTNAME=

(SELECT PRODUCTNAME FROM PRODUCT WHERE COST =
(SELECT COST FROM PRODUCT
ORDER BY COST DESC
FETCH FIRST TWO ROWS ONLY))

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are bind parameters in db2?

1097


How do I delete a table in db2?

1124


What is consistency token in db2?

1194


What is ibm db2 connect?

1054


What is blu acceleration in db2?

1127


What is the role of union all and union

1187


How to check sequence on a table in db2?

1116


What's The Error Code For Unique Index Voilation?

1303


What is copy pending status in db2?

1184


Mention the length of physical storage of the given data types of db2 – date, timestamp, time

1138


How do I connect my db2 database to ibm?

1085


How do I delete a column in db2?

1154


How to find the maximum value in a column in the db2 database?

1126


What is page size in db2?

1025


What is a bind in db2?

1105