Re: DELETE WHERE EXISTS unexpected results - Mailing list pgsql-sql

From Jasen Betts
Subject Re: DELETE WHERE EXISTS unexpected results
Date
Msg-id id7itt$69m$3@reversiblemaps.ath.cx
Whole thread Raw
In response to DELETE WHERE EXISTS unexpected results  (Jeff Bland <bland@us.ibm.com>)
List pgsql-sql
On 2010-11-30, Jeff Bland <bland@us.ibm.com> wrote:
> This is a multipart message in MIME format.
> --=_alternative 007A6509852577EB_=
> Content-Type: text/plain; charset="US-ASCII"
>
> I want to delete certain rows from table USER_TBL. 
> Two tables are involved.  USER_TBL and OWNER_TBL. 

delete ... using  was invented for this purpose.

> In the end I expect the USER_TBL to  not contain the 3  HOME  entries. 
> But what is happening is the whole USER_TBL is empty after the query. 

your subselect is being effected by the table used in the delete.

-- 
⚂⚃ 100% natural


pgsql-sql by date:

Previous
From: Jeff Bland
Date:
Subject: Re: DELETE WHERE EXISTS unexpected results
Next
From: Dimitri
Date:
Subject: Calculate next event date based on instance of the day of week