日期:2014-05-16 浏览次数:21085 次
TRANSFORM Sum(VALUE) AS f3OfSum SELECT 时间 FROM ( select 日期,时间,VALUE from 原表 union all select top 1 '01' as 日期,1 as 时间,null as VALUE from 原表 union all select top 1 '02' as 日期,2 as 时间,null as VALUE from 原表 union all select top 1 '03' as 日期,3 as 时间,null as VALUE from 原表 union all select top 1 '04' as 日期,4 as 时间 ,null as VALUE from 原表 union all select top 1 '05' as 日期,5 as 时间 ,null as VALUE from 原表 union all select top 1 '06' as 日期,6 as 时间 ,null as VALUE from 原表 union all select top 1 '07' as 日期,7 as 时间 ,null as VALUE from 原表 union all select top 1 '08' as 日期,8 as 时间 ,null as VALUE from 原表 union all select top 1 '09' as 日期,9 as 时间 ,null as VALUE from 原表 union all select top 1 '10' as 日期,10 as 时间 ,null as VALUE from 原表 union all select top 1 '11' as 日期,11 as 时间 ,null as VALUE from 原表 union all select top 1 '12' as 日期,12 as 时间 ,null as VALUE from 原表 union all select top 1 '13' as 日期,13 as 时间 ,null as VALUE from 原表 union all select top 1 '14' as 日期,14 as 时间 ,null as VALUE from 原表 union all select top 1 '15' as 日期,15 as 时间 ,null as VALUE from 原表 union all select top 1 '16' as 日期,16 as 时间 ,null as VALUE from 原表 union all select top 1 '17' as 日期,17 as 时间 ,null as VALUE from 原表 union all select top 1 '18' as 日期,18 as 时间 ,null as VALUE from 原表 union all select top 1 '19' as 日期,19 as 时间 ,null as VALUE from 原表 union all select top 1 '20' as 日期,20 as 时间 ,null as VALUE from 原表 union all select top 1 '21' as 日期,21 as 时间 ,null as VALUE from 原表 union all select top 1 '22' as 日期,22 as 时间 ,null as VALUE from 原表 union all select top 1 '23' as 日期,23 as 时间 ,null as VALUE from 原表 union all select top 1 '24' as 日期,24 as 时间 ,null as VALUE from 原表 union all select top 1 '25' as 日期,1 as 时间 ,null as VALUE from 原表 union all select top 1 '26' as 日期,1 as 时间 ,null as VALUE from 原表 union all select top 1 '27' as 日期,1 as 时间 ,null as VALUE from 原表 union all select top 1 '28' as 日期,1 as 时间 ,null as VALUE from 原表 union all select top 1 '29' as 日期,1 as 时间 ,null as VALUE from 原表 union all select top 1 '30' as 日期,1 as 时间 ,null as VALUE from 原表 union all select top 1 '31' as 日期,1 as 时间 ,null as VALUE from 原表 ) q GROUP BY 时间 PIVOT 日期;