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 / sree

SELECT * FROM TABLENAME ORDER BY PRIMARYCOLUMNNAME DESC
FETCH FIRST 5 ROWS ONLY ;

THIS ANSWER IS VALID ONLY IF THERE IS A PRIMARY KEY
COLUMN,OTHERWISE IT WONT WORK

IF THERE IS NO PRIMARY KEY COLUMN IN GIVEN TABLE ,I DON'T
KNOW THE ANSWER

FOR FETCHING FIRST 5 ROWS

SELECT * FROM TABLENAME FETCH FIRST 5 ROWS ONLY;

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between alias and synonym in db2?

1060


What is bind in db2?

975


what is diffrence b/w file-aid tool and file-aid utility???

4809


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

1040


How is deadlock resolved?

1080


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

993


What is the physical storage length of date data type?

1188


List out the three types of page locks that can be held.

1090


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

1053


How can you classify the locks in db2?

1031


What is consistency token in db2?

1060


B37 abend during spufi?

1403


What is the latest version of ibm db2?

1198


What language is db2 written in?

979


How do I create a view in db2?

969