Re: What is the syntax for UPDATE from one table to another?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: pw <p(dot)willis(at)telus(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: What is the syntax for UPDATE from one table to another?
Date: 2004-03-12 18:32:06
Message-ID: 20040312183206.GB7738@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Mar 12, 2004 at 09:40:13 -0800,
pw <p(dot)willis(at)telus(dot)net> wrote:
>
> Hello,
>
> What is the proper syntax for updating a column inone table from
> a column in another?
>
> I have tried this:
>
> UPDATE destination_table FROM source_table SET
> destination_table.column_one = source_table.column_b WHERE constraint;
>
> This fails, so I must have the syntax incorrect.

If you check the documentation you will see that SET is supposed to be before
FROM.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jerry LeVan 2004-03-12 20:12:41 Where are PL/pgsql definitions kept?
Previous Message Jeff 2004-03-12 18:19:35 Re: What is the syntax for UPDATE from one table to another?