I am using Postgres 9.6.9.
I am facing a strange issue with using limit with offset.
Without any limit and offset conditions, I get 9 records.
If I give conditions like-
OFFSET 1 LIMIT 3
OFFSET 2 LIMIT 3
I get the expected no (3) of records at the desired offset.
However I only get 2 records for the following-
OFFSET 5 LIMIT 3
OFFSET 6 LIMIT 3
I should get 3 , as the total no. of records is 9.
For the following conditions I get 3 records-
OFFSET 5 LIMIT 4
OFFSET 6 LIMIT 4
It seems that under some conditions, the LIMIT is internally being decreased by 1 when used with OFFSET.
This is baffling, thanks in advance for any help.
I am facing a strange issue with using limit with offset.
Without any limit and offset conditions, I get 9 records.
If I give conditions like-
OFFSET 1 LIMIT 3
OFFSET 2 LIMIT 3
I get the expected no (3) of records at the desired offset.
However I only get 2 records for the following-
OFFSET 5 LIMIT 3
OFFSET 6 LIMIT 3
I should get 3 , as the total no. of records is 9.
For the following conditions I get 3 records-
OFFSET 5 LIMIT 4
OFFSET 6 LIMIT 4
It seems that under some conditions, the LIMIT is internally being decreased by 1 when used with OFFSET.
This is baffling, thanks in advance for any help.
Comment