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 the uses of db2 optimizer?

1250


How to create backup table in db2?

1056


What is cursor in dbms?

1023


What is a collection in db2?

1002


before altering a table is it necessary to lock ? if lock what is it ? how to do ? ifi want to lock a table what is that command ?

2138


Is schema the same as database?

1018


What is a db2 package?

1011


What is explain in db2?

981


What are concurrency issues?

1049


Is db2 relational database?

942


Give the name of some fields form sqlca.

1040


What is the latest version of ibm db2?

1222


What is db2 stogroup?

1117


What is the default page size of buffer pools?

1087


What is database manager in db2?

980