Tenho em SQL
SELECT *
FROM(SELECT
CASE MONTH(T0.[DocDate])
WHEN 1 THEN 'Jan'
WHEN 2 THEN 'Fev'
WHEN 3 THEN 'Mar'
WHEN 4 THEN 'Abr'
WHEN 5 THEN 'Mai'
WHEN 6 THEN 'Jun'
WHEN 7 THEN 'Jul'
WHEN 8 THEN 'Ago'
WHEN 9 THEN 'Set'
WHEN 10 THEN 'Out'
WHEN 11 THEN 'Nov'
WHEN 12 THEN 'Dez'
END as [Month],
T2.[SlpName] as [Name],
T1.[LineTotal] as [Amount]
FROM ORDR T0
INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode
INNER JOIN OITM T3 ON T1.ItemCode = T3.ItemCode
INNER JOIN OITB T4 ON T3.ItmsGrpCod = T4.ItmsGrpCod
Where Year(T0.[DocDate] ) = 2019 AND T0.CANCELED = 'N')
WorkOrders
PIVOT
(
SUM([Amount])
FOR [Month] IN (
[Jan],[Fev],[Mar],[Abr],
[Mai],[Jun],[Jul],[Ago],
[Set],[Out],[Nov],[Dez]
)
) AS PivotTable
ORDER BY