Re: Is this a bug? - Mailing list pgsql-sql

From Carl van Tast
Subject Re: Is this a bug?
Date
Msg-id 73t1vtk61pcsob9pa0p32a9eou3a31tolh@4ax.com
Whole thread Raw
In response to Is this a bug?  ("Imtiaz. S. M" <imtiaz_sm@yahoo.com>)
List pgsql-sql
On Mon, 12 Nov 2001 21:20:44 -0800, "Jack Gao" <wei@gaofamily.org>
wrote:

>Update tblUserConfig Set Value = '1' From tblUserConfig As a Join
>tblConfigItem As b On a.ItemID = b.ID And b.Scope = 3 Where a.UserID = 1 And
>b.Name = 'UserClassID';
>
>It always update all records in tblUserConfig table!!!

Jack,

don't include the table you want to update in the FROM clause. Just
try:

Update tblUserConfig Set Value = '1' From tblConfigItem As b Where tblUserConfig.ItemID = b.ID   And b.Scope = 3   And
tblUserConfig.UserID= 1   And b.Name = 'UserClassID';
 

Kind regardsCarl van Tast


pgsql-sql by date:

Previous
From: Haller Christoph
Date:
Subject: Re: Joins!!
Next
From: Robert Sundström
Date:
Subject: Re: SQL99