I have a column that can have either NULL or empty space (i.e. \'\') values. I would like to replace both of those values with a valid value like
An alternative way can be this: - recommended as using just one expression -
case when address.country <> '' then address.country
else 'United States'
end as country
Note: Result of checking
nullby<>operator will returnfalse.
And as documented: NULLIF is equivalent to a searched CASE expression
and COALESCE expression is a syntactic shortcut for the CASE expression.
So, combination of those are using two time ofcaseexpression.