UPDATE tuples with a sub-select

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: UPDATE tuples with a sub-select
Date: 2008-11-07 10:15:07
Message-ID: gf14f9$tin$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

are there any plans to support updating a tuple using a sub-select in one of the future versions.

e.g, something like:

UPDATE report_table
SET (order_count,order_value) = (SELECT count(*), sum(amount)
FROM order o
WHERE o.customer_id = report_table.customer_id);

I know it's currently not possible (so we need to revert to two sub-selects) but I was wondering if this somewhere on the "roadmap"

Regards
Thomas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gerhard Heift 2008-11-07 12:30:49 Re: UPDATE tuples with a sub-select
Previous Message Gerhard Heift 2008-11-07 08:44:28 restruct cash table