[3993 - illegal usage of alias name] occured due to alias name for target table in SET. Rewrite below part,
set k.sales_count = m.sales_count
,k.sales_sum = m.sales_sum
to
set sales_count = m.sales_count
,sales_sum = m.sales_sum
↧