On 15 Oct 2019, at 5:38pm, Philippe RIO <[email protected]> wrote:
> The only way is to make a query for getting the number of records and in the
> second query I have to count the number of records retrieved to know if it is
> the last one.
Assume your intended query specifies an order which has unique keys (in other
words, you know exactly what order rows will be answered in. Suppose it is
SELECT ... ORDER BY a, b DESC, c
You can find the last row which will be returned by reversing the order and
adding LIMIT 1
SELECT ... ORDER BY a DESC, b ASC, c DESC LIMIT 1
You can then remember the value(s) of some column(s) of the row returned, and
watch for the same one(s) when you do your desired SELECT.
Depending on the number of rows in your result set, this may or may not be
faster than counting the number of rows.
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users