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

From: John Gage <jsmgage(at)numericable(dot)fr>
To: Bret Fledderjohn <freelancer317(at)gmail(dot)com>
Cc: NOVICE Postgres elist <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Putting an aggregate value in an UPDATE statement...
Date: 2010-06-01 21:03:51
Message-ID: 800FF884-A158-49DE-B612-57DF0DE5E8B0@numericable.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)numericable(dot)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(at)postgresql(dot)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)

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Leif Biberg Kristensen 2010-06-01 21:15:13 Re: Putting an aggregate value in an UPDATE statement...
Previous Message Andrej 2010-06-01 20:47:46 Re: Invitation to connect on LinkedIn