Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 4D09B476ABD for ; Fri, 7 Jun 2002 12:10:06 -0400 (EDT) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id 9425E476A2E for ; Fri, 7 Jun 2002 11:20:04 -0400 (EDT) Received: from [63.195.55.98] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.9) with HTTP id 1502464; Fri, 07 Jun 2002 08:20:08 -0700 From: "Josh Berkus" Subject: Re: UPDATE ... FROM vs standard SQL To: Richard Huxton , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.5.9 Date: Fri, 07 Jun 2002 08:20:08 -0700 Message-ID: In-Reply-To: <200206071133.23179.dev@archonet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200206/71 X-Sequence-Number: 8036 Richard, > I've been happily using statements like > UPDATE a SET flag=1 FROM b WHERE a.id=b.id AND b.foo='x'; > > While PG's FROM extension makes life simple, I can't believe there's > not a way > to do an update on a join using standard SQL. The two options I can > think of I don't understand why you're worried about this. The lack of UPDATE .. FROM is widely regarded as an omission by the ANSI committee, and most SQL RDBMS support it, including MS SQL Server and Oracle. I'm not sure about MySQL, but MySQL doesn't support sub-selects either. Is there a database you're tinking of that sticks to the strict SQL92 definitions? OpenBase, maybe? -Josh Berkus