Re: SQL syntax for updating tables

From: "Moray McConnachie" <moray(dot)mcconnachie(at)computing-services(dot)oxford(dot)ac(dot)uk>
To: <justinlong(at)strategicnetwork(dot)org>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: SQL syntax for updating tables
Date: 2000-04-08 11:44:28
Message-ID: 006e01bfa14f$ccade520$01c8a8c0@malthouse.private.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


----- Original Message -----
From: Justin Long <justinlong(at)strategicnetwork(dot)org>
To: <pgsql-sql(at)postgresql(dot)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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Moray McConnachie 2000-04-08 11:53:21 Re: Speeding up a query
Previous Message tjk@tksoft.com 2000-04-08 05:32:30 Re: update only if single row