換成T-SQL的方法啦
Select * from
(
SELECT CONVERT(DATE,[Main].[Date]) as xxx,COUNT([ProjectNo]) as ZZZ,[ProjectNo] ,COUNT(*) AS Cnt
FROM [Main]
group by CONVERT(DATE,[Main].[Date]) ,[ProjectNo]
) as S
PIVOT
(
SUM(Cnt)
FOR [ProjectNo] IN
([1],[3],[5],[7],[9])
) AS PivotTable
雖然能跑
但是出來GROUPBY 有錯
群組有錯
導致現在嚴重卡點...
他的值是對的
但不是我要的
所以先紀錄一下 = =+
沒有留言:
張貼留言