Hi,
I tried with OFFSET before LIMIT but I have the same problem.
It's always the same record that I have last.
--
Jonathan Camile
On 25 November 2013 18:32, bricklen <bricklen(at)gmail(dot)com> wrote:
>
> On Mon, Nov 25, 2013 at 2:27 AM, <jonathan(dot)camile(at)gmail(dot)com> wrote:
>>
>> WITH filtred_table AS (
>> SELECT c.id
>> FROM my_table t
>> WHERE t.enabled = true
>> AND (t.hdata->'field')::integer = ANY ('{16788}')
>> )
>> SELECT my_table.id
>> FROM my_table
>> WHERE mycontract.id IN (SELECT filtred_table.id FROM filtred_table)
>> ORDER BY my_table.hdata->'field' DESC
>> LIMIT 5
>> OFFSET 5
>>
>
>
> Try with OFFSET 5 LIMIT 5. The offset should be applied *before* the LIMIT.
>