Problem with UPDATE query

From: Johan Daine <johan(dot)daine(at)chello(dot)be>
To: pgsql-novice(at)postgresql(dot)org
Subject: Problem with UPDATE query
Date: 2001-02-09 00:05:24
Message-ID: 3A833444.1DD45DB5@chello.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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 ;
ERROR: parser: parse error at or near "v3"
jd=>

Thanks

--
_/ /_/_/_/ Johan Daine
_/ /_/ _/ mailto:isis(at)wanadoo(dot)be
_/ /_/ _/ http://web.wanadoo.be/isis.w
_/ /_/ _/
_/ /_/ _/
/_/_/_/ /_/_/_/

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Raymond Golish 2001-02-09 01:56:00 arrays of compound types
Previous Message Fred Schroeder 2001-02-08 20:19:16 Getting Started