Re: More records after sort

From: Nicolas Seinlet <nicolas(at)seinlet(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: More records after sort
Date: 2021-07-21 17:25:43
Message-ID: Fw_xFkgR_77EDVaNGxJKwlZ_hbShKe3UGjnZgWoHJtXM2pSJgIenzVv67V90oCYoiyEFHfqm4TXuGg-oVDSQ-A8Z7_LpAd-b6bdiEqr_WF8=@seinlet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks all, I'll try this on Monday when I go back to the office.

Nicolas.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, July 21st, 2021 at 02:55, Rob Sargent <robjsargent(at)gmail(dot)com> wrote:

> > Query:
> >

> > INSERT INTO invl_aml_mapping_temp(invl_id, aml_id, cond)
> >

> >                SELECT il.id, ml.id, 48
> >

> >                    FROM account_invoice_line il
> >

> >                    JOIN account_invoice i ON i.id = il.invoice_id
> >

> >                    JOIN account_move m ON m.id = i.move_id
> >

> >                    JOIN account_move_line ml ON ml.move_id = m.id
> >

> >                    JOIN res_company comp ON comp.id = i.company_id
> >

> >                WHERE il.display_type IS NULL
> >

> >                  AND ml.tax_line_id IS NULL
> >

> >                  AND NOT EXISTS (SELECT invl_id FROM invl_aml_mapping WHERE invl_id=il.id)
> >

> >                  AND NOT EXISTS (SELECT aml_id FROM invl_aml_mapping WHERE aml_id=ml.id)
> >

> >                  AND i.id = 
>

> Out of curiosity, would combining those two NOT EXISTS in one help? Ever? 
>

> > i.e. WHERE invl_id=il.id or aml_id = ml.id

Attachment Content-Type Size
publickey - nicolas@seinlet.com - 0xCAEB7FAF.asc application/pgp-keys 729 bytes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2021-07-21 17:29:49 Re: Have I found an interval arithmetic bug?
Previous Message Bryn Llewellyn 2021-07-21 17:18:34 Re: Have I found an interval arithmetic bug?