SELECT *
FROM T1 INNER JOIN T2 ON T1.C1 = T2.C1
WHERE
( (T1.C3-T2.C3<>0 )
And (CASE WHEN T1.C4 <> T2.C4 THEN 'Changed' END) )
OR
( (T1.C5-T2.C5<>0 )
And (T1.C6-T2.C6<>0) )
This is giving me an error ->
An expression of non-boolean type specified in a context where a condition is expected, near ‘)’.
What is wrong with this statement??
Looking at your Case statement in the were clause, the case statement isn’t compared to any value.
I would suggest moving your case statement into the select statement, or making sure you have a value to compare the case statement to.
ie:
in the where clause: