How many rows does the join produce?
-- a has 2 rows with id = 1 -- b has 3 rows with id = 1 SELECT * FROM a JOIN b ON a.id = b.id;
- 3
- 2
- 5
- 6
Each matching left row pairs with each matching right row, so duplicate keys multiply: 2 x 3 = 6.
Play SQL & Databases ▸