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 |
What is CHECK PENDING ?
SI Stud name Subject Marks Pass/Fail 1 Sham Maths 40 P 1 Sham Physics 50 P 1 Sham Bio 20 F 2 Ram Maths 40 P 2 Ram Physics 50 P 2 Ram Bio 60 P For the above data , write the SQL query for the student who passed in all the subjects . For eg : I want the data of only Ram coz he passed all subjects .
Could anyone clearly explain the diference between sub query and correlated sub query?
What is table space in db2?
How to rename a table in DB2 ?
My SQL is not performing well. Describe how will you fine tune it?
How to find last record before record through SQLRPGLE?
There is a 5000 EMP in company.how we find out the 5th highest getting salary employee outof 5000 employes........
how to resolve -818 error. how to see timestamp token in load module and plan
What is null value in db2?
What is the clustering index in the db2 database?
When you are working with the project after coding what will u do? Like what type of documents u will prepare? How will u do testing?