Re: aggregate functions are not allowed in UPDATE - Mailing list pgsql-general

From David G. Johnston
Subject Re: aggregate functions are not allowed in UPDATE
Date
Msg-id CAKFQuwZBstZizu2rEuB+ML5td2XqYNFMd_StGkaKQ5wCp+rB1A@mail.gmail.com
Whole thread Raw
In response to Re: aggregate functions are not allowed in UPDATE  (Alexander Farber <alexander.farber@gmail.com>)
Responses Re: aggregate functions are not allowed in UPDATE
List pgsql-general
On Tue, Jan 15, 2019 at 9:52 AM Alexander Farber
<alexander.farber@gmail.com> wrote:
>> So calculate the average somewhere else, put the result in a column,
>> and then reference that column in the SET clause.
>>
>
> do you suggest to add a second CTE?

That would qualify as "somewhere else" - as would a simple subquery in FROM.

David J.


pgsql-general by date:

Previous
From: Alexander Farber
Date:
Subject: Re: aggregate functions are not allowed in UPDATE
Next
From: Rich Shepard
Date:
Subject: Re: Refining query statement