I have two tables.
Let's call them T1 and T2.
Each table has two fields (F1 and F2)
I want a single sql statement that will find
1) F1 is the same in both tables
2) values from T2 that do not exist in T1
I'm trying this:
SELECT T2.F2 FROM T1,T2 WHERE
T1.F1=T2.F1
and T1.F2 <> T2.F2
but that gives me everything.
I want the answer of "4".
Let's call them T1 and T2.
Each table has two fields (F1 and F2)
Code:
T1 T2 F1 F2 F1 F2 a 1 a 1 a 2 a 2 a 3 a 3 a 4
1) F1 is the same in both tables
2) values from T2 that do not exist in T1
I'm trying this:
SELECT T2.F2 FROM T1,T2 WHERE
T1.F1=T2.F1
and T1.F2 <> T2.F2
but that gives me everything.
I want the answer of "4".
Comment