Re: sql question
Posted in 1995
In article <DGAt5o.F98@ireq.hydro.qc.ca>,
delmas@ireq.hydro.qc.ca (Herve Delmas) wrote:
> How can we made a sql request on a huge table that will get out
>the last lines without using the rowid column?
>
>ex.: let's say that count(*) return 10000 on this table. If we want to get
> the last fifty lines, for now we are doing:
>
> select col1, col2 from table
> where rowid > 9950>
> Any help will be appreciate!
>
>===========================================================================
==
>--- Herve Delmas ---- delmas@ireq.hydro.qc.ca
>===========================================================================
==
Another thought on the subject that you might consider is to use a scroll
cursor for the select.
All you need to do then is OPEN the cursor, FETCH LAST to get last row,
followed by 49 FETCH PREVIOUS calls.....
More reliable way to do it don't you think?
Mark Denham
BBC
London, UK
Mark.Denham@bbc.co.uk