Column not found in SQL UPDATE

Discuss the database features
Post Reply
Morgan P
Posts: 1
Joined: Mon Dec 05, 2016 2:49 pm

Column not found in SQL UPDATE

Post by Morgan P »

Hi
I have a database "UK Postcodes" with two tables "Population and Households" and "Types"
Table "Population and Households" has columns "SpacelessPostcode" and "MosaicType" (MosaicType values currently null), amongst others and table "Types" has columns "SpacelessPostcode" and "MosaicUK6_Type"
I'm attempting to copy an integer value from column "MosaicUK6_Type" in table "Types" to "MosaicType" in Table "Population and Households" for rows where the "SpacelessPostcode" columns are equal.
Here is my SQL;

UPDATE "Population and Households"
SET "MosaicType" = "Types"."MosaicUK6_Type"
FROM "UK Postcodes"
WHERE ("SpacelessPostcode" = "Types"."SpacelessPostcode")

but I'm getting the error;
Column not found: Types.MosaicUK6_Type
What am I doing wrong?
Open Office 4.1.3, OS10.10
chrisb
Posts: 298
Joined: Mon Jun 07, 2010 4:16 pm

Re: Column not found in SQL UPDATE

Post by chrisb »

the solution is shown here>> viewtopic.php?p=389753#p389753
open office 4.1.14 & LibreOffice 6.4.4.2 x64 using HSQL 1.8.0.10 (Embedded) and HSQL 2.6.0 (Split) on Windows 10
Post Reply