similar questions have been asked on the forums but I seem to have a unique issue with mine. I'm not sure if this is because I don't have a unique ID or because my KEY
is my actual data. I hope you guys can help.
I am trying to merge two tables (Old and New) that have identical column structures.
I want to retain all my values in the Old table and append ONLY new variables from New Table into a Combined Table. Any keys that exist in both tables should take on the value of the Old table.
OLD TABLE
Key | Points
AAA | 1
BBB | 2
CCC | 3
NEW TABLE
Key | Points
AAA | 2
BBB | 5
CCC | 8
DDD | 6
Combined TABLE
Key | Points
AAA | 1
BBB | 2
CCC | 3
DDD | 6
I feel like what I want to achieve is the venn diagram equivalent of this:
... but for whatever reason I'm not getting the intended effect with this code:
CREATE TABLE Combined
SELECT * FROM Old as A
FULL OUTER JOIN New as B ON A.Key=B.Key
WHERE A.Key IS NULL OR B.Key IS NULL;