Re: Update Query Problem - Mailing list pgsql-novice

From Charley Tiggs
Subject Re: Update Query Problem
Date
Msg-id 5A972770-788D-4463-947C-6CD400B63252@xpressdocs.com
Whole thread Raw
In response to Update Query Problem  (<operationsengineer1@yahoo.com>)
Responses Re: Update Query Problem
List pgsql-novice
On Dec 13, 2005, at 11:30 AM, <operationsengineer1@yahoo.com>
<operationsengineer1@yahoo.com> wrote:

> the following update query...
>
> UPDATE t_job_number
> SET contract_id = 30
> WHERE t_serial_number.serial_number_id = 78
> AND t_serial_number.job_number_id =
> t_job_number.job_number_id
>
> yields the following chastisement...
>
> ERROR:  missing FROM-clause entry for table
> "t_serial_number"
>
> can anyone point in the right direction?  requiring a
> from clause in this update seems a little bizarre to
> me - so i'm sure i've botched something up pretty
> good.
>
> tia...

There needs to be a reference to t_serial_number in the update clause:

UPDATE t_job_number, t_serial_number
SET contract_id = 30
WHERE t_serial_number.serial_number_id = 78
AND t_serial_number.job_number_id =
t_job_number.job_number_id

Charley

pgsql-novice by date:

Previous
From:
Date:
Subject: Update Query Problem
Next
From: s anwar
Date:
Subject: How to recover space from a failed cluster