SELECT YEAR(S.TARIH) AS YIL,MONTH(S.TARIH) AS AY,S.STOKKODU,U.STOKADI,SUM(ADET) AS adet,S.GDEPO AS 'GDepo',S.CDEPO AS 'CDepo',S.DURUM AS 'Islem'
FROM stokhareket S
JOIN STOK U ON U.STOKKODU=S.STOKKODU
WHERE S.CDEPO='MU' OR S.GDEPO='MU'
GROUP BY YEAR(S.TARIH),MONTH(S.TARIH),S.STOKKODU,U.STOKADI,S.CDEPO,S.GDEPO,S.DURUM
ORDER BY 3 ASC