update one table with another

From: Matthew Pugsley <matthew(dot)pugsley(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: update one table with another
Date: 2009-04-20 20:34:25
Message-ID: 873251980904201334w1bb49ad4s5fdc9992fab1c09f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've solved it.

I just used a subselect. Worked very quickly. I had a lot of trouble with
subqueries when I first started databases with MySQL. So I have been afraid
of them.

update entities
set customer_status = select(customer_status from entity_dimension_update
where entities.entity_id = entity_dimension_update.entity_id);

Worked almost instantly.

My apologies for the spam.

--
matthew(dot)pugsley(at)gmail(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mikko 2009-04-20 21:00:07 trouble with to_char('L')
Previous Message Bill Moran 2009-04-20 20:28:32 Re: Doubt about join clause