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

How would the varchar column remarks defined?

1035


Why select is not preferred in embedded sql programs?

1227


Explain the benefits you can get from mainframe connect?

910


How to test SQL -911 error while developing COB-DB2 program

7441


What is meant by dclgen?

1060


Who uses db2?

981


What is a db2 table?

954


Define predicate?

1064


What is multi row fetch in db2?

985


How to rename a table in DB2 ?

1029


List out the buffer pools in db2

1019


What language is db2 written in?

979


How is the value function used?

1079


What is cascading rollback?

1133


What are db2 tables?

1049