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

What does db2 plan contain?

973


Is db2 free?

1044


Where can you declare a cursor in a cobol-db2 program?

1011


What is db2 and what is the use of db2 optimizer?

1004


What is runstats db2?

970


What is null in db2?

959


Describe major components of db2?

1051


How to find the number of rows in db2 tables?

1008


What parameters are used to control the free space in DB2?

1016


What is bufferpool in db2?

995


Comment whether the cursor is closed during commit or not.

1047


What is the clustering index in the db2 database?

962


What are catalog tables in db2?

998


have 3 tables table1, table2 and table3 which contains employee information. table1 is master table, table2 contains emp details like emp no and so on, table 3 contains emp salary. so if any emp leave company between 25th - 30th of every month it has to get updated in tables. but it is not getting updated. What is the reason.

1674


What is dbrm?

1053