Re: delete with self join

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: garry saddington <garry(at)schoolteachers(dot)co(dot)uk>, pgsql-general(at)postgresql(dot)org
Subject: Re: delete with self join
Date: 2007-04-16 21:11:07
Message-ID: 651304.60165.qm@web31814.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


--- garry saddington <garry(at)schoolteachers(dot)co(dot)uk> wrote:

> I am trying this syntax which is my interpretation of the docs:
>
> delete from siblings s1 using siblings s2
> WHERE s1.principal = s2.principal
> and s1.sibling=175
>
> Can anyone tell me where I am going wrong?

What is your query do that is different that what you expect? However, I expect that your query
can effectively be reduced to:

delete from siblings where s1.sibling=175;

since "s1.principal = s1.principal" isn't really doing much reduce the number of rows for
deletion.

Regards,
Richard Broersma

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martin Langhoff 2007-04-16 21:40:11 Re: PITR - "Rewind to snapshot" scheme
Previous Message Ketema 2007-04-16 21:07:09 Re: Dynamic DDL