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

How can we read records for specific member in CL? AND rpg?

706


What do you mean by commit and rollback?

1049


What is the difference between spufi and qmf?

1136


What is sqlca’s maximum length?

1195


What is the role of the data page in the db2 database?

1028


How to find the maximum value in a column in the db2 database?

1084


What is the physical storage length of the data types: date, time, timestamp in the db2 database?

1162


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

1032


Are view updateable?

1051


Explain the benefits you can get from mainframe connect?

974


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

1120


What are the various data types available in db2?

1099


Is it possible to create an Instance in DB2 using DB2 Control Center ?

1110


What is table space in db2?

1025


When a COBOL-DB2 program in PRODUCTION is updating main tables and gone for long run, what have to do?

3583