notebox

SQL CROSS JOIN vs Multiple tables in FROM clause in SELECT

The following are functionally equivalent:

SELECT * 
FROM table1, table2
SELECT * 
FROM table1
CROSS JOIN table2

Both perform a cross join, cartesian product.

The second format using the explicit JOIN syntax has been the prefered way of doing a cross join since a long time now.


Reference:


#convention #code