Re: delete with self join - Mailing list pgsql-general

From Richard Broersma Jr
Subject Re: delete with self join
Date
Msg-id 651304.60165.qm@web31814.mail.mud.yahoo.com
Whole thread Raw
In response to delete with self join  (garry saddington <garry@schoolteachers.co.uk>)
List pgsql-general
--- garry saddington <garry@schoolteachers.co.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

pgsql-general by date:

Previous
From: "Ketema"
Date:
Subject: Re: Dynamic DDL
Next
From: "Christan Josefsson"
Date:
Subject: Advanced query rewrite