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>)
Список pgsql-general
On Wed, 26 Jun 2002 10:02:43 +0200, "Peter Alberer"
<h9351252@obelix.wu-wien.ac.at> 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!!!