|
SELECT SUM (a.a) AS AA, SUM (b.b) AS BB
FROM a, b
===============
You are the calculated Cartesian product, of course, it is wrong, you should add the associated conditions, namely:
SELECT SUM (a.a) AS AA, SUM (b.b) AS BB
FROM a, b
where a. primary key = b. primary key |
|