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
null
by<>
operator will returnfalse
.
And as documented:NULLIF
is equivalent to a searchedCASE
expression
andCOALESCE
expression is a syntactic shortcut for theCASE
expression.
So, combination of those are using two time ofcase
expression.