22,209
社区成员
发帖
与我相关
我的任务
分享
select '环比' as years,
str((select month1 from HB2010_JS)*1.0 /(select month12 from Year2009_View)*100) + '%' month1,
str((select month2 from HB2010_JS)*1.0 /(select month1 from Year2010_View)*100) + '%' month2,
str((select month3 from HB2010_JS)*1.0 /(select month2 from Year2010_View)*100) + '%' month3,
str((select month4 from HB2010_JS)*1.0 /(select month3 from Year2010_View)*100) + '%' month4,
str((select month5 from HB2010_JS)*1.0 /(select month4 from Year2010_View)*100) + '%' month5,
str((select month6 from HB2010_JS)*1.0 /(select month5 from Year2010_View)*100) + '%' month6,
str((select month7 from HB2010_JS)*1.0 /(select month6 from Year2010_View)*100) + '%' month7,
str((select month8 from HB2010_JS)*1.0 /(select month7 from Year2010_View)*100) + '%' month8,
str((select month9 from HB2010_JS)*1.0 /(select month8 from Year2010_View)*100) + '%' month9,
str((select month10 from HB2010_JS)*1.0 /(select month9 from Year2010_View)*100) + '%' month10,
0 month11,0 month12,
str((select avgs from HB2010_JS)*1.0 /(select avgs from Year2009_View)*100) + '%' avgs ,
str((select sums from HB2010_JS)*1.0 /(select sums from Year2009_View)*100) + '%' sums
A/B,
A/B,
A/B,
.....
SELECT '环比' AS YEARS,
MONTH1=STR(H.MONTH1*1.0/YV.MONTH12)+ '%',
MONTH2=STR(H.MONTH2*1.0/Y.MONTH1)+ '%',
MONTH3=STR(H.MONTH3*1.0/Y.MONTH2)+ '%',
MONTH4=STR(H.MONTH4*1.0/Y.MONTH3)+ '%',
MONTH5=STR(H.MONTH5*1.0/Y.MONTH4)+ '%',
MONTH6=STR(H.MONTH6*1.0/Y.MONTH5)+ '%',
MONTH7=STR(H.MONTH7*1.0/Y.MONTH6)+ '%',
MONTH8=STR(H.MONTH8*1.0/Y.MONTH7)+ '%',
MONTH9=STR(H.MONTH9*1.0/Y.MONTH8)+ '%',
MONTH10=STR(H.MONTH10*1.0/Y.MONTH9)+ '%',
0 MONTH11,0 MONTH12,
AVGS=STR(H.AVGS*1.0/YV.AVGS) +'%',
SUMS=STR(H.SUMS*1.0/YV.SUMS) +'%',
FROM HB2010_JS H,YEAR2009_VIEW YV,YEAR2010_VIEW Y