I know its almost there, but base is telling me it can't find a column called table1.id when I know its there!
UPDATE table2 SET col1 = (SELECT field1 FROM table1 WHERE table2.id = table1.id) WHERE table1.id = table2.id
I know its almost there, but base is telling me it can't find a column called table1.id when I know its there!
UPDATE table2 SET col1 = (SELECT field1 FROM table1 WHERE table2.id = table1.id) WHERE table1.id = table2.id
UPDATE table2 SET col1 = (SELECT field1 FROM table1 WHERE table2.id = table1.id)
table1 is unknown in the outer SQL.
What I get from your query, this will work
UPDATE table2 SET col1 = t1.field1
FROM table2 t2 INNER JOIN table1 t1 ON t2.id = t1.id
Instead of using a WHERE clause, try using an INNER JOIN clause. It is indeed late so forgive me for my code haha
UPDATE table2
SET col1 = (SELECT field1
FROM table1
WHERE table2.id = table1.id)
INNER JOIN table1
ON table2.id = table1.id
Option 1: No need to have outer WHERE clause.
Option 2: Do not use inner query unneccesarily. Use Inner Join instead