我想SUM(column_a)
从两个不同的表中得到它们,并得到它们的区别。我正在使用 MySQL。
Table A's sum = 1234
Table B's sum = 4001
我不确定要在我的ON
条款中添加什么:
SELECT
SUM(a.column1) AS table_a_sum,
SUM(b.column1) AS table_b_sum,
SUM(a.column1) - SUM(b.column1) AS difference
FROM table_a a
JOIN table_b b
ON ??????