呃,很简单,参考正确例子
update A set 列名 = B.列名 from (select 编码,count(*)as 列名1,SUM(CASE WHEN 条件 THEN 1 ELSE 0 END) AS 列名 from c表 group by 编码) as B where A.编号 = B.编号