Re: How to copy value between tables - Mailing list pgsql-novice

From Oliveiros C,
Subject Re: How to copy value between tables
Date
Msg-id 158688401F5F4A39B3ED2E328F5B3926@marktestcr.marktest.pt
Whole thread Raw
In response to How to copy value between tables  (Michael Rowan <mike.rowan@internode.on.net>)
List 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.rowan@internode.on.net>
To: "postgresql novice" <pgsql-novice@postgresql.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.rowan@internode.on.net
>
> 11 Kingscote Street
> ALBERTON
> South Australia 5014
>
> tel 618 8240 3993
>
>
>
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice

pgsql-novice by date:

Previous
From: Michael Rowan
Date:
Subject: How to copy value between tables
Next
From: Jignesh Shah
Date:
Subject: Re: Install new perl test function in PostgreSQL