Re: Update field to a column from another table

From: "drum(dot)lucas(at)gmail(dot)com" <drum(dot)lucas(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Charles Clavadetscher <clavadetscher(at)swisspug(dot)org>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Update field to a column from another table
Date: 2016-04-21 18:52:58
Message-ID: CAE_gQfVFsxmjR-eH_iBZy1_VWGXL4nrX0ard-8NiJ=eN5X9+nA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

So when I run:

UPDATE ja_jobs t2
> SET time_job = t1.time_job
> FROM junk.ja_test t1
> WHERE t2.id = t1.id
> AND t2.time_job IS DISTINCT FROM t1.time_job;

I get:

UPDATE 2202

So I check the data by doing:

select * FROM public.ja_jobs WHERE id = 14574527

And the "time_job" field is null....

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2016-04-21 19:11:13 Re: Update field to a column from another table
Previous Message John W Higgins 2016-04-21 17:53:05 Re: Add relcreated (timestamp) column to pg_class catalog to record the time an object was created