SELECT
KODU,
ACIKLAMA,
ISLEM,
ISNULL([1],0) as 'Ocak' ,
ISNULL([2],0) as 'Şubat',
ISNULL([3],0) as 'Mart' ,
ISNULL([4],0) as 'Nisan',
ISNULL([5],0) as 'Mayıs' ,
ISNULL([6],0) as 'Haziran',
ISNULL([7],0) as 'Temmuz' ,
ISNULL([8],0) as 'Ağustos',
ISNULL([9],0) as 'Eylül' ,
ISNULL([10],0) as 'Ekim',
ISNULL([11],0) as 'Kasım' ,
ISNULL([12],0) as 'Aralık'
FROM
(
SELECT
KODU,
ACIKLAMA,
ISLEM,
AY,
SATIR_TUTAR
FROM
VW_020_02_MALZEME_HAREKET_DOKUMU
)
AS Src
PIVOT
(
SUM(SATIR_TUTAR)
FOR AY IN ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])
)
AS Pvt