when I wrote a case statement to compare values in tables, it came unstuck with variables that are null. It thinks they are different (note: col1 is a character field).
select a.id,
a.col1 as a_col1,
b.col1 as b.col1,
case when a.col1=b.col1 then 0 else 1 end as chk_col1
from tablea a,
tableb b
where a.id=b.id;
... chk_col1 is always 0 when both col1's are null. I've tried
coalesce(a.col1,'null') as coalesce(b.col1,'null')
but this didn't work either. It still returned 1 for chk_col1.