I am doing a left join query to compare the two tables for any values that do not equal each other on f9 and sumoff6 columns ONLY if the F1 columns are the same. If they are dif
The problem is that allocation_final.sumoff6
has a NULL
value, and the WHERE
condition filters out NULL
values. Just test for this condition:
SELECT statement.f1, statement.f9
FROM statement LEFT JOIN
allocation_final
ON statement.[f1] = allocation_final[f1]
WHERE [allocation_final].sumoff6 <> statement.f9 OR
[allocation_final].sumoff6 IS NULL;
EDIT:
Perhaps your join is in the wrong direction:
SELECT allocation_final.f1, statement.f9, allocation_final.sumoff6
FROM allocation_final LEFT JOIN
statement
ON statement.[f1] = allocation_final[f1]
WHERE allocation_final.sumoff6 <> statement.f9 OR
statement.f9 IS NULL;
Based on your sample data, this would make more sense.