Loading section...

CROSS JOIN (Cartesian product)

Concepts: sqlCrossJoin

A cross join combines every row from one table with every row from another, creating all possible combinations. Syntax Options SQL supports two equivalent syntaxes for cross joins: CROSS JOIN syntax (preferred) Comma syntax (older SQL-89 style) Observe how every row from the first table pairs with every row from the second, producing all possible combinations. Two rows crossed with two rows yields four output rows. This multiplicative behavior is why cross joins require caution with larger tables. Product Variants Cross joins generate all possible combinations. Perfect for creating product variant grids: 3 categories × 3 device types = 9 SKU combinations. This pattern is used for product catalogs, seating charts, calendar grids, and more. Practical Cross Join Uses Cross joins are essential