I have a count statement, I want one condition to be equal and two not equal. If I query country and user_tag separately, I get 0 rows but If I query same time like below I get 10 rows.
What am I doing wrong
COUNT(DISTINCT CASE WHEN
n.country != o.country
OR n.user_tag != o.user_tag
AND n.email_address = o.email_address THEN n.email_address
END) AS OTHER_CHANGES_IN_DATA
FROM OLD o
INNER JOIN NEW n
ON n.user_id = o.user_id
If both country and user_tag is ran like this the results should be 0