re : UPDATES - Mailing list pgsql-novice

From
Subject re : UPDATES
Date
Msg-id 200102121516.f1CFGgx11442@mail.postgresql.org
Whole thread Raw
List pgsql-novice
Hi,

Yes it's possible in where clause.

exemple:
create table t1 (id integer,name varchar(55));
create table t2 (id integer,name varchar(55));


insert into t1 values (1,'toto');
INSERT 25005844 1
log=# insert into t1 values (2,'titi');
INSERT 25005845 1
log=# insert into t2 values (1,'ttttttttt');
INSERT 25005846 1
log=# insert into t2 values (2,'jjjjjjjjj');
INSERT 25005847 1
log=# update t2 set nom2 = 'yyyyyyyyy' where t1.id = t2.id and t1.name = 'toto';
UPDATE 1

You just have to specify join in where clause.

Cheers,

PEJAC pascal

pgsql-novice by date:

Previous
From: "Brett W. McCoy"
Date:
Subject: Re: Problem with UPDATE query
Next
From:
Date:
Subject: re : Problem with UPDATE query