

















可以代替很多游标做的事情。
select str_userid,(sum(case
when (sort<>'MT21' and sort<>'MT22' and sort<>'MS54' and sort<>'MP56')then
(case
when (Isnull(M1,0)/ration)>1.5 then (1.5* Isnull(str_scale,1))
else (Isnull(M1,0)/ration)* Isnull(str_scale,1)
end)
else ((Isnull(M1,0)/ration)* Isnull(str_scale,1))
end)/sum(str_scale))
as m01
from Tongj_VIEW_Menology_Strong
where ration<>0 and ration is not null and year_month='2006'
group by str_userid
order by m01 desc
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。