Re: Problem with UPDATE query

From: "Brett W(dot) McCoy" <bmccoy(at)chapelperilous(dot)net>
To: <isis(at)wanadoo(dot)be>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Problem with UPDATE query
Date: 2001-02-12 15:36:37
Message-ID: Pine.LNX.4.30.0102121035460.7972-100000@chapelperilous.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, 8 Feb 2001, Johan Daine wrote:

> How can I update several columns in one UPDATE query ?
> The users's guide says:
>
> UPDATE table SET col = expression [, ...]
> [ FROM fromlist ]
> [ WHERE condition ]
>
> But this is what I get:
>
> jd=> CREATE TABLE foo (v1 INT2, v2 INT2, v3 INT2 );
> CREATE
> jd=> insert into foo values(1,2,3);
> INSERT 22187 1
> jd=> UPDATE foo SET v2=3 , SET v3=4 WHERE v1=1 ;

UPDATE foo SET v2=3, v3=4 WHERE v1 = 1;

-- Brett
http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
"The only way for a reporter to look at a politician is down."
-- H.L. Mencken

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Mike Hammonds 2001-02-12 18:27:52 Here you have, ;o)
Previous Message pejac 2001-02-12 15:31:22 re : Problem with UPDATE query