create table #
(AreaCD int ,DeptCD int , ExpTypeCD int , BudgetMny numeric(10,2) )create table #1
(AreaCD int ,DeptCD int , ExpTypeCD int , BudgetMny numeric(10,2) )insert into #
select 1, 2, 3, 20.00 union
select 2, 5, 5, 30.00
insert into #1
select 1, 2, 3, 50.00 union
select 2, 4, 6, 30.00select A.AreaCD , A.DeptCD , A.BudgetMny - isnull(b.BudgetMny,0) from # a
left join #1 b
on a.AreaCD = b.AreaCD
and a.DeptCD = b.DeptCD
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货