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 |
what's the best lock size that you could use when you create a tablespace?
What types of tables are there in the db2 database?
Why do we bind in db2?
Can i insert bulk records into a db2 table using qmf of spufi only............!!!
What is the function of logging in the db2 database?
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.
What is subquery ?
Is ibm db2 free?
Mention a credible reason why select* is never given preference in an sql program that has been embedded.
How would the varchar column remarks defined?
What is a Resource Control Table(RCT)? Describe its characteristics.
What is multi row fetch in db2?