表2(总和(col_claim)= 50)
表3(总和(col_release)= 75)
select total_claim-total_release;
结果=(100 + 50) - (75 + 25)= 50
答案 0 :(得分:1)
只需内联子查询并执行算术:
SELECT
(SELECT SUM(col_claim) FROM table1) +
(SELECT SUM(col_claim) FROM table2) -
(SELECT SUM(col_release) FROM table3) -
(SELECT SUM(col_release_two) FROM table4) AS result;