CROSS JOIN command returns a table with all possible combinations of every row from the first table and every row from the second table.
This is also called a Cartesian join since it returns the Cartesian product of each row selected in the join.
SELECT column(s) FROM first_table CROSS JOIN second_table;
Select one or more columns from
second_table to return a table with the Cartesian product of these rows.
This example selects
Styles from the
Furniture table and
Name from the
Colors table. It uses a
CROSS JOIN to return a table with combinations of each furniture style and color.
SELECT Furniture.Style, Colors.NameFROM FurnitureCROSS JOIN Colors;