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 / mayur bhayani

SELECT * FROM (SELECT * FROM T ORDER BY pk DESC FETCH FIRST 5 ROWS) AS X
ORDER BY PK;

Is This Answer Correct ?    3 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can you do the explain of a dynamic sql statement?

1126


What is a bind in db2?

1043


What is the difference between dbm cfg and db cfg file in db2 ?

1539


When the like statement is used?

1223


List out the data types available.

1153


How to retrieve rows from a db2 table in embedded sql?

1394


How to resolve deadlock issue

20137


Mention some fields that are a part of sqlca.

1035


What is a collection in db2?

1036


How to check table size in db2 sap?

1041


What is bind in db2?

1050


How to restart a DB2 program?

1904


How to get the ddl of a table in db2?

1131


How do you find the maximum value in a column in db2?

1108


Are views updateable?

1164