A join without a condition is a cross join. Cross join repeats each row for the left table for each row in the right table:
FROM table_a a CROSS JOIN table_b b
Note that in MySQL cross join / join / inner join identical. Therefore you can write:
FROM table_a a JOIN table_b b
As long as you omit the on clause, this will work as a cross join.
If you want to sum two columns from two tables, cross join won't work because it repeats rows. You will get very high numbers. For sums, the best approach uses subqueries, @sgeddes answers.
source share