Is it possible to write join query without ON
statement? and how do these joins differ LEFT JOIN, RIGHT JOIN
works.
This question is related to
mysql
join
left-join
inner-join
right-join
See some example in http://www.sitepoint.com/understanding-sql-joins-mysql-database/
You can use 'USING' instead of 'ON' as in the query
SELECT * FROM table1 LEFT JOIN table2 USING (id);
There are several ways to do a cross join or cartesian product:
SELECT column_names FROM table1 CROSS JOIN table2;
SELECT column_names FROM table1, table2;
SELECT column_names FROM table1 JOIN table2;
Neglecting the on condition in the third case is what results in a cross join.
Source: Stackoverflow.com