Ok, pretty much self explanatory
UPDATE table1
SET table1.col1 = table2.col1,
table1.col2 = table2.col2
FROM table1, table2
WHERE table2.col = table1.col
Or using alias:
SET table1.col1 = table2.col1,
table1.col2 = table2.col2
FROM table1, table2
WHERE table2.col = table1.col
UPDATE A1
SET A1.col1 = A2.col1,
A1.col2 = A2.col2
FROM table1 A1, table2 A2
WHERE A2.col = A1.col
SET A1.col1 = A2.col1,
A1.col2 = A2.col2
FROM table1 A1, table2 A2
WHERE A2.col = A1.col
1 comments:
Always good to remember how to do it!
Post a Comment