pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Carl van Tast <vanTast@Pivot.at>
To: pgsql-sql@postgresql.org
Subject: Re: Is this a bug?
Date: Tue, 13 Nov 2001 11:26:12 +0100
Message-ID: <73t1vtk61pcsob9pa0p32a9eou3a31tolh@4ax.com> (raw)
References: <9sqakt$op1$1@news.tht.net>

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 regards
 Carl van Tast



view thread (7+ messages)  latest in thread

Message-ID: <73t1vtk61pcsob9pa0p32a9eou3a31tolh@4ax.com>
Permalink:  ../73t1vtk61pcsob9pa0p32a9eou3a31tolh@4ax.com/
Also on:    postgresql.org/message-id/73t1vtk61pcsob9pa0p32a9eou3a31tolh@4ax.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: vanTast@Pivot.at
  Subject: Re: Is this a bug?
  In-Reply-To: <73t1vtk61pcsob9pa0p32a9eou3a31tolh@4ax.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox