Received: from smtp.stellison.co.uk ([212.56.66.225]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eB8BTIZ68288 for ; Fri, 8 Dec 2000 06:29:18 -0500 (EST) (envelope-from francis@stellison.co.uk) Received: (qmail 22768 invoked from network); 8 Dec 2000 11:29:35 -0000 Received: from unknown (HELO neo) (unknown) by unknown with SMTP; 8 Dec 2000 11:29:35 -0000 From: "Francis Solomon" To: , "liste SQL" Subject: RE: subqueries as values in updates Date: Fri, 8 Dec 2000 11:30:12 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-reply-to: <3A30DB68.6B97A867@anpe.fr> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Archive-Number: 200012/60 X-Sequence-Number: 391 Hi, The syntax you used works fine for me. francis=# select version(); version --------------------------------------------------------------- PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc 2.95.2 (1 row) Hope this helps Francis Solomon > -----Original Message----- > From: pgsql-sql-owner@postgresql.org > [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of > patrick.jacquot@anpe.fr > Sent: 08 December 2000 13:00 > To: liste SQL > Subject: [SQL] subqueries as values in updates > > > hello, list. > are subqueries alloved as values in an update command ? > e.g. > > update a set a.attribute1 = a.attribute1 + > (select sum(b.attribute1) from b where b.attribute2=a.attribute2); > > If yes, how is the correct syntax ? > If not, is there a hope for it in a future version ?