Update field to a column from another table

From: "drum(dot)lucas(at)gmail(dot)com" <drum(dot)lucas(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Update field to a column from another table
Date: 2016-04-21 05:09:54
Message-ID: CAE_gQfWFAvW+k4GdPWFQAuVBr_4TSRx7vpPEzSTeWf1WjkJrww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've got two tables:

- ja_jobs
- junk.ja_jobs_23856

I need to update the null column ja_jobs.time_job with the data from the
table junk.ja_jobs_23856

So I'm doing:

>
> UPDATE public.ja_jobs AS b
> SET time_job = a.time_job
> FROM junk.ja_jobs_23856 AS a
> WHERE a.id = b.id
> AND a.clientid = b.clientid;

But it's now working... I'm using PostgreSQL 9.2

Do you guys have an idea why?

cheers;
Lucas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Charles Clavadetscher 2016-04-21 05:53:28 Re: Update field to a column from another table
Previous Message John R Pierce 2016-04-21 03:24:10 Re: Is it possible to call Postgres directly?