| From: | Jonathan Camile <jonathan(dot)camile(at)gmail(dot)com> |
|---|---|
| To: | bricklen <bricklen(at)gmail(dot)com> |
| Cc: | pgsql-bugs(at)postgresql(dot)org |
| Subject: | Re: BUG #8629: Strange resultset when using CTE or a subselect |
| Date: | 2013-11-25 19:32:45 |
| Message-ID: | CAOrxoaFNsZunmGgg137k+mdOBXRO64hNsFZ7_iMDqv=oX=Cbbw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
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.
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Johnston | 2013-11-25 19:38:57 | Re: BUG #8629: Strange resultset when using CTE or a subselect |
| Previous Message | bricklen | 2013-11-25 17:32:58 | Re: BUG #8629: Strange resultset when using CTE or a subselect |