

























临时表每个字段都要有名字才行。
select * from (
select bab2.str_Userid,(bab2.fin/bab3.fin)as ration from (
select str_Userid,cast(count(*)as numeric)as fin from (
select str_userid,sort, (M1/ration)as mon
from Tongj_VIEW_Menology_Strong
where ration<>0 and year_month='2006') as tab
where mon >=1
group by str_userid)as bab2 ,
(
select str_Userid,cast(count(*)as numeric)as fin from (
select str_userid,sort, (M1/ration)as mon
from Tongj_VIEW_Menology_Strong
where ration<>0 and year_month='2006') as tab
group by str_userid)as bab3
where bab2.str_Userid=bab3.str_Userid)as table1
order by ration desc
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。