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

select productname from product p where 2=(select count(*) from product q where p.cost<=q.cost)

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does runstats do in db2?

1186


What is difference between rollback and commit?

1205


What are iseries servers?

1132


Name the various locking levels available?

1134


What is the maximum size of varchar data type in db2?

1177


What is the difference between cursor stability and repeatable read isolation levels?

1238


What is multi row fetch in db2?

1103


What are the two types of logging in the db2 database? Explain them.

1125


What is database reorganization?

1185


What types of tables are there in the db2 database?

1101


What is the reason behind not using select * in embedded sql programs?

1169


How many databases are there?

1112


What is runstats utility in db2?

1070


While unloading huge amount of data from table. Suddenly job failed some error. Imagine 1M data unloading, In that 90% data unloaded only 10% left, So if want to unload the rest 10% what needs to be done? Whether do i need to start from top or anything ?

2387


On which levels locks can be applied?

1205