22,300
社区成员




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)