Updating a table from another table

From: Matthew Price <pricem(at)juno(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Updating a table from another table
Date: 2002-06-04 20:37:30
Message-ID: 20020604.163820.15423.68377@wm13.nyc.untd.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Howdy All,

I need to update many records in one table with data from another table that ultimately gets \copy-ed from an outside source.

customers:
custnum varchar(6),
name text,
canceldate date
...

cancels:
custnum varchar(6),
canceldate date

What is the right way to update the canceldate in the customers table from canceldate in the cancels table? Is there a way to use update to iterate rather than making a mass change?

Thanks in advance,
Matthew

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today! For your FREE software, visit:
http://dl.www.juno.com/get/web/.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jean-Luc Lachance 2002-06-04 21:38:19 Re: Updating a table from another table
Previous Message Joel Burton 2002-06-04 17:26:32 Re: Is this a feature ?