SQL CROSS JOIN clause is used to combine rows from two or more tables, based on a related column between them. SQL cross joins are used to join the table having no condition in which all the records of the first table comes with all the records of the second table.

Cross join is also called a Cartesian product.

Unlike an INNER JOIN or LEFT JOIN, the cross join does not establish the relationship between the joined tables. When each row of the first table is combined with each row from the second table, known as Cartesian join or cross join.

SQL CROSS JOIN Example

The CROSS JOIN joined every row from the first table (T1) with every row from the second table (T2).

In other words, the cross join returns the Cartesian product of rows from both the tables. The number of rows in a Cartesian product is the product of the number of rows in each involved tables.

#sql #sql cross join #inner join

SQL CROSS JOIN Example | SQL Join Query Types
1.70 GEEK