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?

Answers were Sorted based on User's Feedback



Shall i use this query to retrieve first 4 records, Select empno, sal from emptbl where empno <..

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

Shall i use this query to retrieve first 4 records, Select empno, sal from emptbl where empno <..

Answer / mr. cooooool

Hi.............

No. you cann't use this.
this query will display records less than 5.
not to for first 4 records.

For exm.
Suppose i have duplicate records like
Empno
1
2
1
1
3
4
then it display all the above records.
b'coz these all r less than 5.


Thanks.

Is This Answer Correct ?    9 Yes 1 No

Shall i use this query to retrieve first 4 records, Select empno, sal from emptbl where empno <..

Answer / anju

I dont think records are stored in the sorted order of primary key in DB2. It happens only in VSAM!

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More DB2 Interview Questions

What is a plan and package in db2?

0 Answers  


How can you display the current date & current time ?

1 Answers   Cap Gemini,


If a non-DB2 program calls a DB2 program, the calling program's name will be there in SYSIN of IKJEFT01 and the plan name will be that of the called program. But is a bind needed or a plan has to be created for the non-DB2 program also?

1 Answers   RBS,


What are the uses of db2 optimizer?

0 Answers  


Generally if I want to select the names starting with c I need to use c% But how could I code to select the data which contains % as a part of data.

5 Answers  


In my table having 100 Rec. How can I delete the 7th row?? (we don't know what is data inside the table)

9 Answers   IBM,


how to copy the host variables from ps file into cobol program other than include statement

1 Answers   Syntel,


Which component is responsible for db2 startup and shutdown?

0 Answers  


What is buffer pool?

0 Answers  


assume ther are 5000 records in a database and want to fetch using cursor. cursor fetches only 3000 records and fetch is not happening for remaining 2000 records. why it happens and how to rectify it

1 Answers   TCS,


What statistic will tell the DBA how must space can be reclaimed from dropped table spaces on the next reorg run?

1 Answers  


How many buffer pools are there in DB2?

2 Answers  


Categories