之前月份的加上12-月的数字。。。后强行把月份弄成一列都是12月。然后匹配12月的比例就行了
比如11月假如你存的是 11数字 多一列出来就让它变成12,然后用多的这一列子查询12月的就行
类似这样?
select
t1.month_num,
t1.number_total,
t1.number_total*t2.bl1 as zl1,
t1.number_total*t2.bl2 as zl2
from
(
select 11 as month_num,30 as number_total,11+(12-11) as December
union all
select 10 as month_num,50 as number_total,10+(12-10) as December) t1
join
(select 12 as month_num,1000 as number_total,0.45 as bl1, 0.92 as bl2 ) t2
on t1.December=t2.month_num