I have two tables (Table1, Table2) containing a 'Year' field (i.e. Values of '1998', '1999', '2000' ..... '2007').
Both are data Source tables.
I have a third (Table3) which I need to update depending on a SELECT DISTINCT YEAR statement form the other two tables. Once I populate Table3 with the Years from Table1, how do I then only add records from Table2 which aren't already contained in Table3.
So TABLE3 should contain:
I know the first query is:
INSERT INTO dbo.TABLE3
SELECT DISTINCT dbo.TABLE1.[YEAR]
GROUP BY dbo.TABLE1.[YEAR]
But how do I add the values from Table2?
Thanks in advance,
A Northern Soul