Produces the cartesian product of two tables — every row of the left combined with every row of the right. No join condition.
Produces a Cartesian product: every row in the first table paired with every row in the second. Can be extremely large and expensive. Occasionally useful for generating combinations (e.g., all date/user pairs) when paired with a WHERE clause that filters most results away.
| Database System | Support Status | Since Version | Notes |
|---|---|---|---|
| MySQL | ✓ Supported | all | CROSS JOIN keyword or comma syntax (FROM a, b) both produce a cartesian product. |
| PostgreSQL | ✓ Supported | all | CROSS JOIN keyword or comma syntax (FROM a, b) both produce a cartesian product. |
| SQL Server | ✓ Supported | all | CROSS JOIN keyword or comma syntax (FROM a, b) both produce a cartesian product. |
| Oracle | ✓ Supported | all | CROSS JOIN keyword or comma syntax (FROM a, b) both produce a cartesian product. |
| SQLite | ✓ Supported | all | CROSS JOIN keyword or comma syntax (FROM a, b) both produce a cartesian product. |
Rarely needed in application code but useful for generating combinations or test data. N rows × M rows = N*M result rows.
CROSS JOIN keyword or comma syntax (FROM a, b) both produce a cartesian product.
CROSS JOIN keyword or comma syntax (FROM a, b) both produce a cartesian product.
CROSS JOIN keyword or comma syntax (FROM a, b) both produce a cartesian product.
CROSS JOIN keyword or comma syntax (FROM a, b) both produce a cartesian product.
CROSS JOIN keyword or comma syntax (FROM a, b) both produce a cartesian product.