-- 会sql吗?会。ok,那就好说了。
select m.a,n.b,(m.a-n.b)/n.b as tqb from
(select sum(value) as a from tab where rq >='2017-12' and rq<='2018-01' )m
left join
(select sum(value) as b from tab where rq >='2016-12' and rq<='2017-01')n
on 1=1
-- 把上面SQL脚本中的日期处理下就OK啦~