Re: [GENERAL] UPDATE tuples with a sub-select

2008-11-07 Thread Gerhard Heift
On Fri, Nov 07, 2008 at 11:15:07AM +0100, Thomas Kellerer wrote: > 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) >

Re: [GENERAL] UPDATE tuples with a sub-select

2008-11-07 Thread Thomas Kellerer
Tom Lane, 07.11.2008 14:33: Thomas Kellerer <[EMAIL PROTECTED]> writes: are there any plans to support updating a tuple using a sub-select in one of the future versions. It's the first item under UPDATE on the TODO list ... That is good news :) Thanks Thomas -- Sent via pgsql-general ma

Re: [GENERAL] UPDATE tuples with a sub-select

2008-11-07 Thread Thomas Kellerer
Gerhard Heift, 07.11.2008 14:47: What about: UPDATE report_table SET order_count = s_count, order_value = s_value FROM (SELECT count(*) AS s_count, sum(amount) AS s_value FROM order o WHERE o.customer_id = report_table.customer_id) Its untested, but I think, it must works like this. Inter

Re: [GENERAL] UPDATE tuples with a sub-select

2008-11-07 Thread Gerhard Heift
On Fri, Nov 07, 2008 at 02:31:42PM +0100, Thomas Kellerer wrote: > Gerhard Heift, 07.11.2008 13:35: >>> 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)

Re: [GENERAL] UPDATE tuples with a sub-select

2008-11-07 Thread Tom Lane
Thomas Kellerer <[EMAIL PROTECTED]> writes: > are there any plans to support updating a tuple using a sub-select in one of > the future versions. It's the first item under UPDATE on the TODO list ... regards, tom lane -- Sent via pgsql-general mailing list (pgsql-genera

Re: [GENERAL] UPDATE tuples with a sub-select

2008-11-07 Thread Thomas Kellerer
Gerhard Heift, 07.11.2008 13:35: 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

Re: [GENERAL] UPDATE tuples with a sub-select

2008-11-07 Thread Gerhard Heift
On Fri, Nov 07, 2008 at 11:15:07AM +0100, Thomas Kellerer wrote: > 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) >

[GENERAL] UPDATE tuples with a sub-select

2008-11-07 Thread Thomas Kellerer
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 WHE