Select sum(amt) as totalA from tableA where id>10;
Select sum(amount) as totalB from tableB where people = 'JOSH';
如果目标是sum(totalA + totalB)
?
答案 0 :(得分:2)
select sum(total) from
(
select sum(amt) as total from tableA where id>10
union all
select sum(amount) from tableB where people = 'JOSH'
) as q