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...

Shall i use this query to retrieve first 4 records,

Select empno, sal from emptbl where empno < 5. like this can
we fetch first 100 records?

Answer Posted / madhu t

if empno is a primary key then the records in table are
stored in ascending order of empno. hence we can use empno
< 5 to fetch the first 4 records of table.
There is also a standar query to fetch the first 10/100/200
records as below...
select empno,sal from emptble fetch first 100 rows only;

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we retrieve the total number of records in RPG & CLLE?

580


What is a db2 collection?

982


What is dbrm in db2 database?

1035


Which component is used to execute the sql statements?

1055


What is a db2 schema?

1175


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

1057


What do you mean by between and in? Is between inclusive of specified range values?

1041


How do I change the column size in db2?

1084


What is runstats db2?

967


What is coalesce in db2?

1058


Before you give the explain statement, what are the prerogatives?

970


What is netezza database?

960


What is multi row fetch in db2?

988


What is cursor with hold option in db2?

1013


How to fetch the last row from the table in SQL (db2)?

1590