日期:2014-05-18 浏览次数:20785 次
select DICount,(ISNULL(DIClickCount,0)) as ClickCount,(case ISNULL(DICount,0) when 0 then 0 else ISNULL(DIClickCount,0)/DICount end) as ClickConvert ,ISNULL(DI_EffectCount,0) as EffectCount,(case ISNULL(DI_EffectCount,0) when 0 then 0 else isNull(DI_EffectCount,0)/DICount end) as EffectConvert from SK_DetailInfo
select DICount,(ISNULL(DIClickCount,0)) as ClickCount, (case ISNULL(DICount,0) when 0 then 0 else 1.00*ISNULL(DIClickCount,0)/DICount end) as ClickConvert ,ISNULL(DI_EffectCount,0) as EffectCount,(case ISNULL(DI_EffectCount,0) when 0 then 0 else isNull(DI_EffectCount,0)/DICount end) as EffectConvert from SK_DetailInfo
------解决方案--------------------
cast((case ISNULL(DICount,0) when 0 then 0 else ISNULL(DIClickCount,0)*1./DICount end) as decimal(8,2)) as ClickConvert