Re: How to copy value between tables

From: "Oliveiros C," <oliveiros(dot)cristina(at)marktest(dot)pt>
To: "Michael Rowan" <mike(dot)rowan(at)internode(dot)on(dot)net>, "postgresql novice" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: How to copy value between tables
Date: 2009-08-26 13:53:21
Message-ID: 158688401F5F4A39B3ED2E328F5B3926@marktestcr.marktest.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Howdy, Michael.

I didnt try your query, but at first glance, it seems OK, why do you ask?

Did you try and it gave u some kind of error?

Best,
Oliveiros

----- Original Message -----
From: "Michael Rowan" <mike(dot)rowan(at)internode(dot)on(dot)net>
To: "postgresql novice" <pgsql-novice(at)postgresql(dot)org>
Sent: Wednesday, August 26, 2009 2:40 PM
Subject: [NOVICE] How to copy value between tables

> Will the following work?
>
> UPDATE child SET child_name = (SELECT parent_name FROM parent WHERE
> parent_id = child_parent_id) WHERE child_name = 'not known' ;
>
> That is, copy the parent_name into the corresponding child_name if the
> child_name was 'not known'
>
>
> Michael Rowan
> mike(dot)rowan(at)internode(dot)on(dot)net
>
> 11 Kingscote Street
> ALBERTON
> South Australia 5014
>
> tel 618 8240 3993
>
>
>
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Jignesh Shah 2009-08-26 14:42:10 Re: Install new perl test function in PostgreSQL
Previous Message Michael Rowan 2009-08-26 13:40:35 How to copy value between tables