I have a table as follows:
table 1
temp_id node_name variable_1 variable_2 variable_3
1 ab a b y
2 sdd a a a
3 u a s s
and another table as follows:
table 2
temp_id node_name variable_1 variable_2 variable_3
1 ab as sb y
2 sdd a a a
3 u a s s
I want to fetch all the records from table 1 where variable_1, variable_2 and variable_3 of table 1 doesnot match with table 2.
How can I do that in TSQL?
—EDIT—
The above will “fetch all the records from table 1 where variable_1, variable_2 and variable_3 of table 1 doesnot match with table 2”, as you asked.
However, it seems that you want to match the specific rows from table 2 not just any rows (BTW, you should have specified that in your question). If that is the case, Marco’s answer looks good.