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

Поиск
Список
Период
Сортировка
От John Gage
Тема Re: Putting an aggregate value in an UPDATE statement...
Дата
Msg-id 800FF884-A158-49DE-B612-57DF0DE5E8B0@numericable.fr
обсуждение исходный текст
Ответ на Re: Putting an aggregate value in an UPDATE statement...  (Bret Fledderjohn <freelancer317@gmail.com>)
Ответы Re: Putting an aggregate value in an UPDATE statement...  (Leif Biberg Kristensen <leif@solumslekt.org>)
Re: Putting an aggregate value in an UPDATE statement...  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Andrej
Дата:
Сообщение: Re: Invitation to connect on LinkedIn
Следующее
От: Leif Biberg Kristensen
Дата:
Сообщение: Re: Putting an aggregate value in an UPDATE statement...