I\'m wondering why a conditional cross join must have the condition(s) specified in the WHERE clause, and why it doesn\'t work in the \'ON\' clause. See link for com
CROSS JOIN is the SQL operator to perform a full cartesian product between two tables. Since it is a cartesian product, it does not allow any condition during the operation, you can only restrict its result with some filtering operation (the WHERE condition).
JOIN (INNER and OUTER JOIN, that is) operators, are simply cartesian product together with the filtering operator expressed in the ON part of the operator (and in fact in the original syntax of SQL there was no JOIN operator, simply the “comma” notation to denote the product with the join condition expressed always in the WHERE part).
Examples:
"old" notation:
SELECT ...
FROM table1 t1, table2 t2
WHERE t1.attribute = t2.attribute
equivalent to the "modern" notation:
SELECT ...
FROM table1 t1 INNER JOIN table2 t2 ON t1.attribute = t2.attribute
while, for the cartesian product:
"old" notation:
SELECT ...
FROM table1 t1, table2 t2
equivalent to the "modern" notation:
SELECT ...
FROM table1 t1 CROSS JOIN table2 t2
In other words, a CROSS JOIN that require a condition is actually some kind of INNER JOIN.