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 / venkat ramana

SELECT PRODUCTNAME
FROM PRODUCT
WHERE COST < (SELECT MAX(COST)FROM PRODUCT)
ORDER BY COST DESC
FETCH FIRST 1 ROW ONLY ;

HOPE THE ABOVE QUERY WILL PROVIDE YOU THE DESIRED RESULT.

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is db2 bind?

1015


What is the advantage in De-normalizing tables in DB2?

1112


How can you find out the # of rows updated after an update statement?

1050


What is an instance in db2?

981


What is package in db2 mainframe?

916


Define sqlca.

1053


What is db2 plan table?

991


Mention some fields that are a part of sqlca.

969


What is catalog database in db2?

1098


Why do we need reorg in db2?

919


List out the buffer pools in db2

1018


What is the syntax for FETCH in DB2 ?

1136


How to find schema of a table in db2?

950


What is the latest version of ibm db2?

1198


What language is db2 written in?

979