日期:2014-05-17 浏览次数:20396 次
declare @date date,@costname varchar(20),@remark varchar(max)
with cte
as
(
select SUM(consig) consig,SUM(shouldmoney) shouldmoney
from
B inner join C on B.ID=C.ID
where C.date=@date and C.isClose='1'
)
select consig,shouldmoney,@costname,@remark
into A
from cte