日期:2014-05-18 浏览次数:20507 次
select sum(isnull(s.SignCount,TrainCount)) as Count from TrainInfo T left join SignInfo S on T.TrainId=S.TrainId
------解决方案--------------------
select SumCount = case when sum(signcount) is null then sum(traincount)
else sum(traincount) + sum(signcount)
end
from TrainInfo left join SignInfo on TrainInfo.TrainId=SignInfo.TrainId