答案 0 :(得分:0)
使用apply
运算符
select 'Project_1' as ProjectTitle, TimeByDay, sum(Work) as TaskCumulativeWork
from table t cross apply (
values ('2017-07-04', [2017-07-04]),
. . .
('2017-07-12', [2017-07-12])) t1(TimeByDay, Work)
group by TimeByDay
order by TimeByDay desc;
但是,我还建议修复数据模型。