Re: [SQL] DELETE WHERE EXISTS unexpected results

2010-12-01 Thread Jasen Betts
On 2010-11-30, Jeff Bland 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 inv

Re: [SQL] DELETE WHERE EXISTS unexpected results

2010-12-01 Thread Jeff Bland
: Jeff Bland/Poughkeepsie/i...@ibmus Cc: pgsql-sql@postgresql.org Date: 12/01/2010 08:05 AM Subject: Re: [SQL] DELETE WHERE EXISTS unexpected results Sent by: cgourof...@gmail.com You don't have to include the name of the "delete table" in the subselect. Wrong: DELETE FROM SP.TST

Re: [SQL] DELETE WHERE EXISTS unexpected results

2010-12-01 Thread Carla
You don't have to include the name of the "delete table" in the subselect. Wrong: DELETE FROM SP.TST_USER_TBL WHERE EXISTS (SELECT SP.TST_USER_TBL.NAME FROM *SP.TST_USER_TBL, *SP.TST_OWNER_TBL WHERE TYPE='BLAND' AND PLACE='HOME' AND SP.TST_OWNER_TBL.NAME

[SQL] DELETE WHERE EXISTS unexpected results

2010-11-30 Thread Jeff Bland
I want to delete certain rows from table USER_TBL. Two tables are involved. USER_TBL and OWNER_TBL. The entries that match BLAND type in OWNER table and who also have a matching entry in USER table NAME but only for USER_TBL entries with places equal to HOME. DELETE FROM SP.TST_USER_TBL WH