pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SQL syntax for updating tables
2+ messages / 2 participants
[nested] [flat]

* SQL syntax for updating tables
@ 2000-04-07 19:46  Justin Long <justinlong@strategicnetwork.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Justin Long @ 2000-04-07 19:46 UTC (permalink / raw)
  To: pgsql-sql

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.

Any suggestions?

_____
Justin Long
Network for Strategic Missions
1732 South Park Court, Chesapeake, VA 23320
Ofc 757-420-4500, Fax 757-226-5006, Email justinlong@strategicnetwork.org
Never retreat. Never surrender. Never cut a deal with a dragon.
http://www.strategicnetwork.org





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: SQL syntax for updating tables
@ 2000-04-08 11:44  Moray McConnachie <moray.mcconnachie@computing-services.oxford.ac.uk>
  parent: Justin Long <justinlong@strategicnetwork.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Moray McConnachie @ 2000-04-08 11:44 UTC (permalink / raw)
  To: justinlong@strategicnetwork.org; 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.







^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-04-08 11:44 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-04-07 19:46 SQL syntax for updating tables Justin Long <justinlong@strategicnetwork.org>
2000-04-08 11:44 ` Moray McConnachie <moray.mcconnachie@computing-services.oxford.ac.uk>

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