Re: Putting an aggregate value in an UPDATE statement...

From: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Putting an aggregate value in an UPDATE statement...
Date: 2010-06-01 21:15:13
Message-ID: 201006012315.13986.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tuesday 1. June 2010 23.03.51 John Gage wrote:
> Thanks. I tried that _without_ the parentheses around the select
> statement and it didn't work.
>
> At the risk of further displaying ignorance, why are the parens
> necessary, what do they do?

I don't know the technical answer, but as an intuitively derived rule of
thumb: Whenever you need the output of a subselect in an outer query, put the
subselect in parentheses. It becomes second nature after a while.

regards,
--
Leif Biberg Kristensen
http://solumslekt.org/blog/

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2010-06-01 21:15:52 Re: Putting an aggregate value in an UPDATE statement...
Previous Message John Gage 2010-06-01 21:03:51 Re: Putting an aggregate value in an UPDATE statement...