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...

How will fetch last 5 rows from table in db2

Answer Posted / vaneeshh khurana

See there is no direct method to do so, but still if we want
last 5 rows only we can create a logic which is as follows.

1. Declare an array to save the fetch rows with occurs of 5.
2. Now fetch the rows and start saving in that array such
that when the count becomes 5 overwrite the 6th fetch in the
first occurs similarly the 7th fetch on the 2nd occur.
3. Now when all the fetching is done the array will contains
the last 5 fetched rows.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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 ?

2176


What is difference between isnull and coalesce?

1052


How do we specify index to include or not during bind process.

2124


What r the comman abends in db2, jcl and cobol???????

2250


Mention the location where the output received from explain statement is stored.

1120


What's The Error Code For Unique Index Voilation?

1225


What is dclgen in db2?

1139


What is bind in db2?

1034


How to create backup table in db2?

1085


What is meant by union and union all?

1006


What is the picture clause of null indicator variable?

1132


What is database alias db2?

1121


What is isolation level in db2?

997


How do I add a column to a table in db2?

1100


Explain the function of data manager.

1041