Re: Is this a bug?

From: Carl van Tast <vanTast(at)Pivot(dot)at>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Is this a bug?
Date: 2001-11-13 10:26:12
Message-ID: 73t1vtk61pcsob9pa0p32a9eou3a31tolh@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, 12 Nov 2001 21:20:44 -0800, "Jack Gao" <wei(at)gaofamily(dot)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 regards
Carl van Tast

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Gintas 2001-11-13 13:42:08 Help with INSERT into 2 tables
Previous Message Haller Christoph 2001-11-13 09:35:24 Re: Joins!!