Re: Putting an aggregate value in an UPDATE statement... - Mailing list pgsql-novice

From John Gage
Subject Re: Putting an aggregate value in an UPDATE statement...
Date
Msg-id 800FF884-A158-49DE-B612-57DF0DE5E8B0@numericable.fr
Whole thread Raw
In response to Re: Putting an aggregate value in an UPDATE statement...  (Bret Fledderjohn <freelancer317@gmail.com>)
Responses Re: Putting an aggregate value in an UPDATE statement...
Re: Putting an aggregate value in an UPDATE statement...
List pgsql-novice
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?

But the answer, as usual, is extremely simple and clear.   Thanks very, very much!

John


On Jun 1, 2010, at 10:45 PM, Bret Fledderjohn wrote:

See Below:

On 1 June 2010 16:28, John Gage <jsmgage@numericable.fr> wrote:
This statement:


UPDATE question_choices SET total_rows = count(*) from care_lesson

UPDATE question_choices SET total_rows = (select count(*) from care_lesson);



--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice



--

- Bret
____________________________________________
"Why should I fret in microcosmic bonds
That chafe the spirit, and the mind repress,
When through the clouds gleam beckoning beyonds
Where shining vistas mock man's littleness?"
- H.P. Lovecraft, "Phaeton" (1918)

pgsql-novice by date:

Previous
From: Andrej
Date:
Subject: Re: Invitation to connect on LinkedIn
Next
From: Leif Biberg Kristensen
Date:
Subject: Re: Putting an aggregate value in an UPDATE statement...