Re: DELETE with JOIN syntax

From: Brian Wong <bwlist(at)gmail(dot)com>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: DELETE with JOIN syntax
Date: 2005-07-27 20:31:28
Message-ID: e1c904a40507271331429f6450@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/27/05, Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> wrote:
>
> I think the where t2.column_id is null where column_id is the joining
> column makes this a form of not exists, so maybe:
>
> DELETE FROM t1 WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE t2.column_id =
> t1.columnid);
>
>

This looks good. Thanks.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John DeSoi 2005-07-27 20:32:27 Re: GUID for postgreSQL
Previous Message Jaime Casanova 2005-07-27 20:26:58 Re: Bad plan when null is in an "in" list