日期:2014-05-17 浏览次数:20469 次
select *
from
(
select m.学号,SUM(欠费合计) as t
from table1 as m
where m.学号 not like '%人'
group by m.学号
)a
full join
(
select n.* from table2 as n
where n.欠费金额 != 0 AND n.学号 is not null
)b
on a.学号 = b.学号
select *
from
(
select m.学号,SUM(欠费合计) as t
from table1 as m
where m.学号 not like '%人'
group by m.学号
)a
full join
(
select n.* from table2 as n
where n.欠费金额 != 0 AND n.学号 is not null
)b
on a.学号 = b.学号
where isnull(a.欠费,0) <> isnull(b.欠费,0)