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

with e as (select product_name,cost,rank() over(order by
cost desc) as rk from product) select * from e where rk=2;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you use max on a char column?

1143


i tried to copy some records from microsoft excel to as-400 physical file through "Bosanova" emulation. Out of 14000 records only 12000 records copies and subsequently programe started to hang. Then, i closed the program forcefully. I did' under stand the problem. Also when i try to compile the physical file it is showing as "The file in use". How to overcome this problem?

2595


Following a db2 update statement, what is the quickest way to compute the total number of updated rows?

1136


What is the difference between oracle and db2?

1173


What is database manager in db2?

1065


What is the difference between cursor and select statement?

1152


When the like statement is used?

1280


What is db2 bind process?

1292


What is the difference between nvl and coalesce?

1107


How do I delete a table in database?

1079


What is a db2 tablespace?

1119


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

7671


How do you eliminate duplicate values in db2?

1268


What is bind package and plan in db2?

1109


What is the use of value function?

1209