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

Can we update view in db2?

1054


What is a Foreign Key?

1140


How would the varchar column remarks defined?

1131


What are iseries servers?

1133


What is a page in db2?

1074


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

1130


How do you pull up a query which was previously saved in qmf?

1206


what is db2 restart?

2214


What does db2 mean?

1085


Can you use max on a char column?

1144


My sql statement select avg(salary) from emp yields inaccurate results. Why?

1132


How to take backup of table in db2?

1122


If the cursor is kept open followed the issuing of commit, what is the procedure to leave the cursor that way?

1222


What is a collection in db2?

1094


How and when does the db2 enforces the unique key?

1143