Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 8EE5D4759C5 for ; Fri, 7 Jun 2002 06:45:11 -0400 (EDT) Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by postgresql.org (Postfix) with ESMTP id 02A74475C9D for ; Fri, 7 Jun 2002 06:45:05 -0400 (EDT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-34.mail.demon.net with esmtp (Exim 3.35 #1) id 17GHEs-0008dq-0Y for pgsql-sql@postgresql.org; Fri, 07 Jun 2002 11:45:02 +0100 Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id D682C140DA for ; Fri, 7 Jun 2002 11:33:24 +0100 (BST) Content-Type: text/plain; charset="us-ascii" From: Richard Huxton Organization: Archonet Ltd To: pgsql-sql@postgresql.org Subject: UPDATE ... FROM vs standard SQL Date: Fri, 7 Jun 2002 11:33:23 +0100 User-Agent: KMail/1.4.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200206071133.23179.dev@archonet.com> X-Archive-Number: 200206/64 X-Sequence-Number: 8029 I've been happily using statements like UPDATE a SET flag=3D1 FROM b WHERE a.id=3Db.id AND b.foo=3D'x'; While PG's FROM extension makes life simple, I can't believe there's not a = way=20 to do an update on a join using standard SQL. The two options I can think o= f=20 are: 1. using a sub-select=20 UPDATE a SET flag=3D1 WHERE a.id IN (SELECT id FROM b WHERE b.foo=3D'X'); Which is fine, but no good for mysql, hits PG's speed issue with IN and a b= it=20 clumsy for more complicated examples. 2. building an updatable view. Am I missing something here? TIA - Richard Huxton