Re: how to retrieve specific number of rows
Whaom! You did again felix! I really should familiarize myself more with this LIMIT feature. But, shouldnt the ORDER BY also have a DESC?
I mean, this statement sais:
give me all the records, order them, in ascending order (that's old ones first, then the newer ones), then return them starting from row number 5 (which is actually the 6th row, because the first has row number 0) up to that large integer 10000000 or so.
So by saying
SELECT *
FROM t
ORDER BY ts DESC
LIMIT 5, 10000000
we do the same thing, but with a reversed (first the new ones e.g. with larger ts values, then the older ones) order for the ts column. (you can write ASC explicitly, but its also the default, so you rarely see it written out)
(BTW Sorry ibakebread for causing the confusion. )