pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Moray McConnachie <moray.mcconnachie@computing-services.oxford.ac.uk>
To: justinlong@strategicnetwork.org
To: pgsql-sql@postgresql.org
Subject: Re: SQL syntax for updating tables
Date: Sat, 8 Apr 2000 12:44:28 +0100
Message-ID: <006e01bfa14f$ccade520$01c8a8c0@malthouse.private.net> (raw)
References: <01BFA0A8.629AB840.justinlong@strategicnetwork.org>


----- 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.







view thread (2+ messages)

Message-ID: <006e01bfa14f$ccade520$01c8a8c0@malthouse.private.net>
Permalink:  ../006e01bfa14f$ccade520$01c8a8c0@malthouse.private.net/
Also on:    postgresql.org/message-id/006e01bfa14f$ccade520$01c8a8c0@malthouse.private.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: moray.mcconnachie@computing-services.oxford.ac.uk, justinlong@strategicnetwork.org
  Subject: Re: SQL syntax for updating tables
  In-Reply-To: <006e01bfa14f$ccade520$01c8a8c0@malthouse.private.net>
  References: <01BFA0A8.629AB840.justinlong@strategicnetwork.org> <006e01bfa14f$ccade520$01c8a8c0@malthouse.private.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox