第1个回答 推荐于2018-05-06
select ip,addr,sum(次数) from(
select ip,addr,次数 from table1
union all
select ip,addr,次数 from table2)
group by ip,addr本回答被提问者和网友采纳
第2个回答 2012-10-09
select a.ip,a.addr,isnull(a.次数,0)+isnull(b.次数,0) 次数 from 表1 a left join 表2 b on a.ip=b.ip and a.addr=b.addr