Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id DF94F475EBC for ; Thu, 3 Oct 2002 04:19:02 -0400 (EDT) Received: from egwn.net (ns2.egwn.net [193.172.5.4]) by postgresql.org (Postfix) with ESMTP id 1F575475D1C for ; Thu, 3 Oct 2002 04:19:00 -0400 (EDT) Received: from fibers.upc.es (gw01.es3.egwn.net [212.9.66.13]) (authenticated) by egwn.net (8.11.6/8.11.6/EGWN) with ESMTP id g938ISf25865 for ; Thu, 3 Oct 2002 10:18:28 +0200 Message-ID: <3D9BFD56.5020808@fibers.upc.es> Date: Thu, 03 Oct 2002 10:18:30 +0200 From: Thrasher Organization: =?ISO-8859-1?Q?Delegaci=F3_Alumnes_FIB?= User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.1b) Gecko/20020721 X-Accept-Language: es-es, en-us MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Updating from select References: <3D9B28B7.4000903@fibers.upc.es> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-MailScanner: Found to be clean X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/34 X-Sequence-Number: 9752 Hi Manfred, Such a silly thing blocked me, and I was about to write a stored procedure. Thanks a lot !! BTW, does anyone knows about a RH7.2 or newer RPM of v7.3? Do I need any other tools not included in RH7.2 to compile it? Thrasher Manfred Koizar wrote: > On Wed, 02 Oct 2002 19:11:19 +0200, Thrasher > wrote: > >>UPDATE trans_log t SET t.cost = >> (SELECT SUM(p.cost) FROM products_log p WHERE p.trans = t.id) > > > Thrasher, try it without the table alias t: > > UPDATE trans_log SET cost = > (SELECT SUM(p.cost) FROM products_log p > WHERE p.trans = trans_log.id) > > Servus > Manfred > >