Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group