| From: | Bryce Nesbitt <bryce1(at)obviously(dot)com> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Subject: | How to copy data between joined columns? |
| Date: | 2006-04-07 20:32:22 |
| Message-ID: | 4436CC56.3040707@obviously.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
I have a need to copy/update data from one column to another, based on a
join condition. Is this easy to do in pure SQL? I have google'ed
without luck for a easy solution (that's not Microsoft specific, that
is). For example:
postgres=#
select xx_thing.date_start,xx_note.created_date
from xx_thing
join xx_issue using (thing_id) join xx_note using (issue_id)
where xx_note.created_date is not null;
date_start | created_date
----------------+---------------------
2006-03-17 | 1900-01-01
(...many... rows)
I need to copy date_start to created_date, for all records that meet a
particular where condition.
-Bryce Nesbitt
--
----
Visit http://www.obviously.com/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Scott Marlowe | 2006-04-07 20:34:49 | Re: How to copy data between joined columns? |
| Previous Message | Sachin | 2006-04-07 18:55:13 | [ocpfree] For my direct Client Looking for Mainframe const urgently |