Putting an aggregate value in an UPDATE statement...

Поиск
Список
Период
Сортировка
От John Gage
Тема Putting an aggregate value in an UPDATE statement...
Дата
Msg-id 4769D3C0-C894-4CBE-8318-467303665862@numericable.fr
обсуждение исходный текст
Ответы Re: Putting an aggregate value in an UPDATE statement...  (Bret Fledderjohn <freelancer317@gmail.com>)
Список pgsql-novice
This statement:


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


returns the following error (which is well-documented):


ERROR:  cannot use aggregate function in UPDATE
LINE 1: UPDATE question_choices SET total_rows = count(*) from care_...


I wondered how I can put a row count from one table into another?  I
can't figure it out.

Thanks very much,

John Gage


В списке pgsql-novice по дате отправления:

Предыдущее
От: Jeanne Louize Emygdio
Дата:
Сообщение: Invitation to connect on LinkedIn
Следующее
От: Mariateresa L
Дата:
Сообщение: Re: sql files in psql ?