I have a table that has two primary keys, first_name and last_name and also has about 10 other columns. I want to update it using another table that has the exact same schema but many have new values to add or update to the old table. What is the correct SQL query?
The code I have so far is:
UPDATE OLD_DATA AS old
SET val_1 = new.val_1 ,
val_2 = new.val_2 ,
FROM NEW_DATA AS new
WHERE old.first_name = new.first_name
AND old.last_name = new.last_name
But this doesn't add new data, it only updates old data.
