I've run into a problem where I'd like to copy data between columns based on a condition from a related table. Looking at the top answer from eglasius on this similar problem similar problem I came up with this solution:
UPDATE table1 SET table1.column2 = table2.column1
FROM table1 NATURAL JOIN table2
WHERE table2.column1 = "myCondition"
This query gave me a syntax error beginning at FROM
although replacing the UPDATE
clause with a SELECT
seemed to yield no problems.