22,207
社区成员
发帖
与我相关
我的任务
分享
declare @s nvarchar(4000)
set @s='Insert into stockMonth(YearMonth, matid,model1,LocateID,Beginqty,BeginTotal)
select A200906,matid,isnull(modell,''),locateID ,Sum(IsNULL(EndQty,0),Round(Sum(IsNULL(EndTotal,0)),2)
from stockmonth
where yearmonth=''200905''
group by stockMonth MatID,StockMonth,model1,StockMonth.LocateID '
exec(@s)