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
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 |
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 |
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 |
Once you create a view, where would information about the view be stored?
What is image copy in db2?
What is the max length of sqlca?
Usually, which is more important for DB2 system performance - CPU processing or I/O access?
What is usage pointer in cobol?
What is the role of union all and union
How is a typical DB2 batch program executed ?
While creating a table, by mistake you have given size of one field as 10. But as per requirement size should be 8. What is your next step?
Mention the downsides of page level lock.
DB2 is a A) data base/data communication system B) data base C) RDBMS D) Programming language
What is meant by dclgen?
what is a trigger and types of triggers