When I don't have right side I get NULL on column StatusOfDeduplication instead 5.
What is wrong with this query ?
select c.Code AS Code, c.DefaultName AS Name, c.Status AS Status,
case cp.TargetCodeStatus when Null then 5 else cp.TargetCodeStatus end as StatusOfDeduplication from Cities c LEFT JOIN CityPackages cp ON cp.TargetCode = c.Code