T-SQL 101: 101 Using CROSS JOIN
The simplest way to join two tables is what’s called a cross-join. So this is where I say from products, cross-join, sales territories.
SELECT *
FROM dbo.Products
CROSS JOIN dbo.SalesTerritories;
Now what that will do though is it will give me every combination of rows from the two tables. So I’ll get one row from the second table for each row in the first table. This is often called a Cartesian product of the two tables and it can quickly end up generating a very large number of rows.
2025-01-28