I want to fetch the 10th row of a table which has been
changed.How can I do it without going thru all the rows.
Answers were Sorted based on User's Feedback
Answer / m4io
DECLARE cursor_name sensitivity SCROLL CURSOR FOR
SELECT ... FROM ...
FETCH ABSOLUTE 10 FROM cursor_name
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / divya,roshini,tiny
use scrollable cursor for fetching the 10th row
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / andyb
Why?
How do you know the one you want is still the 10th row ?
Other updates may have taken place.
If you know the key for the record you want then use that
Otherrwise unless the table has a sequential numeric key
then I think you have to go through the rows.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / nadeem
Use any one column name and its value of the 10th row to
fetch the 10th..for eg
select * from Table where deptno = 0010(any column name and
its value of 10 row)
| Is This Answer Correct ? | 1 Yes | 5 No |
Answer / satish.klnm
exec sql
select * from table222 where count(*) > 9
end-exec.
| Is This Answer Correct ? | 0 Yes | 14 No |
List out the data types available.
Normalization in DB2 – first normal form, second normal form
What is phantom read in db2?
how to identify the pseudo conversation by seeing the program
My DB2 program first read the data from a file and then it look into a table with the data it got from the file.If we did not bind the program , should the file read before SQL execution be success??
What is EXPLAIN?
What is release/acquire in bind?
how do you resolve -805?
query to just fetch first matching row and stop execution. once one matching row is found ..no more records should be checked.. if the first record is matching.. the query must stop
Is db2 a database?
What is an inner join, and an outer join ?
I have a DB2 table which has 1000 rows.after udatingg first 110 rows, my job abends. Now what I have to do if I want to restart the job next time so that it should start updating from 111th row (without updating first 110 rows again).