yani
Kod: Tümünü seç
SELECT
SUM(CASE WHEN (CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,tar))))=(CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,@tarx)))) and (sattip ='hiz' or sattip ='urn') THEN round((TUTAR*(dbo.dovpar(dvbrm,@dvzx,sattar))),0) ELSE 0.0 END) AS gcirotop,
SUM(CASE WHEN (month(CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,tar))))=month(CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,@tarx))))) and (year(CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,tar))))=year(CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,@tarx))))) and (sattip ='hiz' or sattip ='urn') THEN round((TUTAR*(dbo.dovpar(dvbrm,@dvzx,sattar))),0) ELSE 0.0 END) AS acirotop,
SUM(CASE WHEN (year(CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,tar))))=year(CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,@tarx))))) and (sattip ='hiz' or sattip ='urn') THEN round((TUTAR*(dbo.dovpar(dvbrm,@dvzx,sattar))),0) ELSE 0.0 END) AS ycirotop,
SUM(CASE WHEN (CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,tar))))=(DATEADD(YY,-1,CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,@tarx))))) and (sattip ='hiz' or sattip ='urn') THEN round((TUTAR*(dbo.dovpar(dvbrm,@dvzx,sattar))),0) ELSE 0.0 END) AS lgcirotop,
SUM(CASE WHEN (month(CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,tar))))=month(DATEADD(YY,-1,CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,@tarx)))))) and (year(CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,tar))))=year(DATEADD(YY,-1,CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,@tarx)))))) and (sattip ='hiz' or sattip ='urn') THEN round((TUTAR*(dbo.dovpar(dvbrm,@dvzx,sattar))),0) ELSE 0.0 END) AS lacirotop,
SUM(CASE WHEN year(CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,tar))))=year(DATEADD(YY,-1,CONVERT(DATETIME,FLOOR(CONVERT(FLOAT,@tarx))))) and (sattip ='hiz' or sattip ='urn') THEN round((TUTAR*(dbo.dovpar(dvbrm,@dvzx,sattar))),0) ELSE 0.0 END) AS lycirotop ....
bunu nasıl bir mantıkla yaparsam daha verimli yani hızlı yapabilrim butun mantıklara acıgım simdiden teşekkürler