Re: Updating from select - Mailing list pgsql-sql

From Manfred Koizar
Subject Re: Updating from select
Date
Msg-id e3cmpuka7i9fpuu3o37u99j45plub789cu@4ax.com
Whole thread Raw
In response to Updating from select  (Thrasher <thrasher@fibers.upc.es>)
List pgsql-sql
On Wed, 02 Oct 2002 19:11:19 +0200, Thrasher <thrasher@fibers.upc.es>
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)

ServusManfred


pgsql-sql by date:

Previous
From: "Beth Gatewood"
Date:
Subject: Re: indexing on char vs varchar
Next
From: Josh Berkus
Date:
Subject: Re: indexing on char vs varchar