From: | Thrasher <thrasher(at)fibers(dot)upc(dot)es> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Updating from select |
Date: | 2002-10-03 08:18:30 |
Message-ID: | 3D9BFD56.5020808@fibers.upc.es |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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 <thrasher(at)fibers(dot)upc(dot)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)
>
> Servus
> Manfred
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Shridhar Daithankar | 2002-10-03 12:36:10 | Large databases, performance |
Previous Message | Joe Conway | 2002-10-03 03:14:49 | Re: split function for pl/pgsql |