Dynamic update

From: Simon Drabble <simon(at)eskimo(dot)com>
To: Postgres Group <pgsql-general(at)postgreSQL(dot)org>
Subject: Dynamic update
Date: 1999-11-03 18:39:53
Message-ID: Pine.LNX.4.10.9911031335390.19115-100000@dragon.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is it possible to update a column with another column's value, say

UPDATE member SET votes = `SELECT count(votes) FROM ballot WHERE id = 1`;

with or without aggregates?

Tried everything I can think of, searched the docs, reading the finished parts
of Bruce's book...

If not, are there truly dynamic SQL-only (i.e. without resorting to external
functions) ways to achieve this? Am I being obtuse and missing something
obvious?

Simon.

--
"Linux - open doors, not windows."

Simon Drabble It's like karma for your brain.
simon(at)eskimo(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alain TESIO 1999-11-03 19:09:09 Re: [GENERAL] Dynamic update
Previous Message Bruce Momjian 1999-11-03 18:17:48 Re: [GENERAL] HAVING QUESTION