I am trying to insert data into a table from another where the data does not exist yet
In the table into which I insert the data,
CREATE TABLE
INSERT INTO
VALUES('AAA',10,100),('AAB',11,102),('AAC',12,130)
In the table, I select data from
CREATE TABLE
INSERT INTO
VALUES('AAA',3,10,100),('AAA',3,10,106)
In this case, I want to choose ('AAA',3,10,106)
from # T1, because the combination AAA, 106 does not exist in #T
Basically I want to populate a unique combination of names and identifiers
I tried below which does not seem to work
SELECT *
FROM
WHERE NOT EXISTS(SELECT * FROM