I’m stumped.
Let’s say I’ve got a table, ‘1’, with three columns, ‘A’, ‘B’, ‘C’. Column ‘C’ has some NULL values. Another table, ‘2’, has columns ‘A’ (that matches table ‘1’) and ‘C’, where ‘C’ is complete.
How can I merge the values from table ‘2’ into table ‘1’ in MYSQL?
I’ve tried, and swore up and down it should work:
UPDATE 1
SET 1.C = 2.C
FROM 1 JOIN 2
ON 1.A = 2.A
WHERE 1.C IS NULL;
And clues? hints? ideas?
This works:
Answer updated based on requirements changed. T2 could be a view, so a join might be a better idea. I don’t know much about views, though, so I just moved out of the UPDATE line t2… but I’m not sure if it changes anything.