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

Can a primary key have null values? If we try to insert a null value in a primary key column, will it work or give an error code?

6 Answers  


What is the syntax for FETCH in DB2 ?

0 Answers   MCN Solutions,


1. what if null values retrived from database and no null indicator mentioned in query. What is sql code.

1 Answers   Cap Gemini,


Where do you specify them?

0 Answers  


Which transaction use a command thread ?

1 Answers  


Hi, i would like to start a new carrier in DB2 DBA.Which and what all step should i have to take..?

0 Answers  


What is the advantage in De-normalizing tables in DB2?

0 Answers  


What does DML stand for and what are some examples of it?

3 Answers   IBM,


What is the use of db2?

0 Answers  


AGGREGATE function support by DB2. A) SUM & AVG B) SUM, MIN & AVG C) SUM, MAX, AVG , MIN &COUNT D) NONE

2 Answers   Accenture,


What is the role of schema in the db2 database?

0 Answers  


What is the SQL Communications Area and what are some of its key fields?

1 Answers  


Categories