select money from t1;
select money from t2;
两张表没有关联字段,求 两张表money的和,sql怎么写?
select money from t2;
两张表没有关联字段,求 两张表money的和,sql怎么写?
解决方案
40
select
sum(money) as money
from
(
select sum(money) as money from t1
union all
select sum(money) as money from t2
) as tt
sum(money) as money
from
(
select sum(money) as money from t1
union all
select sum(money) as money from t2
) as tt