Copy data from one table to another based on mulitple joins
This sample shows how to copy data from table A to table B based on multiple join columns.
INSERT INTO B(Value1, Value2)SELECT DISTINCT Value1, Value2FROM A t1WHERE NOT EXISTS(SELECT 1 FROM B t2WHERE t1.Value1 = t2.Value1AND t1.Value2 = t2.Value2)
Comments
Post a Comment