He joins the E
table to set the values in `C' to values based on the different updates. Let's break it down.
c.party_first_name = e.customername
Here, if there is no match, the party_first_name
will be set to NULL
c.party_type =
CASE
WHEN e.ClassificationType is not null THEN e.ClassificationType
ELSE c.party_type
END
Here, if there is no match, the party_type
will stay whatever it is set in C
, with no change.
If there is a match, then it will set party_type
to e.classificationType
c.tax_indicator =
case
when c.party_type='entity' then e.TaxNonTaxGovernmentIDNumberEntitiesTaxNonTaxGovernmentIDType
Else NULL
END
Here, if the party_type
is equal to entity
then it will take whatever value is in e.TaxNonTaxGovernmentIDNumberEntitiesTaxNonTaxGovernmentIDType
regardless of a match or not. If the party_type
does not equal entity
then it will be set to NULL