CROSS JOIN
A join with no pairing rule, which pairs every row of one table with every row of the other.
In more detail
Six rows crossed with eight rows give forty-eight. Written on purpose, it builds a complete grid, such as every status with every category, so missing combinations show as zero instead of disappearing. Write CROSS JOIN in full so a reader knows it is intended.
Related terms
- Cartesian product — Every possible pairing of one item from each of two sets, so the number of pairs is the product of the two sizes.
- join — Combining rows from two tables into one result by pairing rows according to a rule, usually matching keys.
- comma join — The old join syntax that lists tables separated by commas in FROM and puts the pairing rule in WHERE.
Taught in
- Cross Joins And Cartesian Bugs — PostgreSQL, Indexing & Relational Data Modeling