Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

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: Mon, 16 Apr 2007 14:11:07 -0700 (PDT)
  • Message-id: <651304(dot)60165(dot)qm(at)web31814(dot)mail(dot)mud(dot)yahoo(dot)com>

--- 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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group