34,575
社区成员
发帖
与我相关
我的任务
分享
select a.名称,a.日期,sum(b.生产量)
from yourTable a inner join yourTable b on a.名称=b.名称 and a.日期>=b.日期
group by a.名称,a.日期
SELECT SUM(production.Production.Volume) AS Volume, production.Grade.GradeName, CONVERT(varchar(10), production.Production.CutDate, 120) AS CutDate
FROM production.Production INNER JOIN
production.Grade ON production.Production.GradeID = production.Grade.GradeID
GROUP BY CONVERT(varchar(10), production.Production.CutDate, 120), production.Grade.GradeName
select
1月1号,
1月1号+1月2号 as 1月2号,
1月1号+1月2号+1月3号 as 1月3号,
1月1号+1月2号+1月3号+1月4号 as 1月4号
from tb