sql server,一个表根据字段向另一张表添加或更新数据

2025-02-01 02:07:40
推荐回答(1个)
回答1:

--没有时添加
select Name,other,sum(Number) as Number
from B
where not exists(select 1 from A where Name=b.Name and Other=a.Other)
group by Name,other