select sum(c) from aselect sum(d) from b然后两个值手工减一下
select aa.cc-bb.dd from (select sum(c) cc from a) as aa,(select sum(d) dd from b) as bb