Re: SQL syntax for updating tables - Mailing list pgsql-sql

From Moray McConnachie
Subject Re: SQL syntax for updating tables
Date
Msg-id 006e01bfa14f$ccade520$01c8a8c0@malthouse.private.net
Whole thread Raw
In response to SQL syntax for updating tables  (Justin Long <justinlong@strategicnetwork.org>)
List pgsql-sql
----- Original Message -----
From: Justin Long <justinlong@strategicnetwork.org>
To: <pgsql-sql@postgresql.org>
Sent: Friday, April 07, 2000 8:46 PM
Subject: [SQL] SQL syntax for updating tables


> I'm trying to figure this out and I'm stumped. Perhaps someone else has
> done it.
>
> I have two tables:
>
> SIGMEMBER
>
> and
>
> MEMBER
>
> The MEMBER table has a USERID field and an EMAIL field. SIGMEMBER has the
> same two fields. I am trying to update SIGMEMBER from MEMBER such that
when
> member.userid = sigmember.userid, it replaces sigmember.email with
> member.email.

UPDATE sigmember SET sigmember.email=member.email WHERE
sigmember.userid=member.userid;

should work.






pgsql-sql by date:

Previous
From: "tjk@tksoft.com"
Date:
Subject: Re: update only if single row
Next
From: "Moray McConnachie"
Date:
Subject: Re: Speeding up a query