Olaf Beckman Lapré <[EMAIL PROTECTED]>
wrote:
My question centers on how to implement this using SQLite as I'm not
really sure how to retrieve 'record numbers 445 to 456' using SQL
statements efficiently.
The simplest approach:
select * from tableName limit 12 offset 445;
This is actually not very efficient, since "offset 445" clause is
implemented by enumerating from the beginning and simply discarding the
first 444 records. So the query would run ever slower as the offset
increases.
If you display records in some order, and need to implement, say, PgDn,
you can do something like this:
select * from tableName where field > 'lastValue'
order by field limit 12;
where 'lastValue' is the value of "field" in the last visible row. This
works much faster assuming there's an index on "field". If you don't
have any natural order to impose, you can order on ROWID.
Igor Tandetnik
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------