Re: [GENERAL] Dynamic update

From: Alain TESIO <alain_tesio(at)yahoo(dot)com>
To: Simon Drabble <simon(at)eskimo(dot)com>, Postgres Group <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] Dynamic update
Date: 1999-11-03 19:09:09
Message-ID: 19991103190909.29682.rocketmail@web301.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-- Simon Drabble <simon(at)eskimo(dot)com> wrote:
> 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?

Have you tried a more direct command ?

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

(I can't test right now but I don't see why this wouldn't work ...)

Alain

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Timothy H. Keitt 1999-11-03 19:17:52 query seems too slow
Previous Message Simon Drabble 1999-11-03 18:39:53 Dynamic update