Re: Updating values of a record variable

Поиск
Список
Период
Сортировка
Искать
От
Manfred Koizar
Тема
Re: Updating values of a record variable
Дата
Msg-id
va5jhu0ivgpulpj592n7ith30df3jig91p@4ax.com
Ответ на
Список
Дерево обсуждения
Updating values of a record variable "Peter Alberer" <h9351252@obelix.wu-wien.ac.at>
Re: Updating values of a record variable Manfred Koizar <mkoi-pg@aon.at>
On Wed, 26 Jun 2002 10:02:43 +0200, "Peter Alberer"
 wrote:
>It should run thru every row of lr_concepts and count the number of
>related records in the acs_rels table. The value of the count should be
>written into the column "related_lr" of the table lr_concepts.

Peter, try:

UPDATE lr_concepts
   SET related_lr = (
           SELECT COUNT(*)
             FROM acs_rels a
            WHERE a.rel_type = 'lr_concept_rel' AND
                  a.object_id_one = lr_concepts.lr_concept_id);

Servus
 Manfred


В списке pgsql-general по дате отправления
От: Curt Sampson
Дата:
Сообщение: Shared Memory Sizing
От: Saito Yasuhiro
Дата:
Сообщение: Re: Need help on index!!!
FAQ