CROSS JOIN for all combinations

It is the cartesian products of both tables, if you're a math nerd.

πŸ“Œ Syntax:
πš‚π™΄π™»π™΄π™²πšƒ *
π™΅πšπ™Ύπ™Ό πšπšŠπš‹πš•πšŽ_𝟷
π™²πšπ™Ύπš‚πš‚ 𝙹𝙾𝙸𝙽 πšπšŠπš‹πš•πšŽ_𝟸

Note that there is no need for an ON clause.

CROSS JOIN is useful for getting all combinations
- Matching users with all dates.
- Match product tables with color tables to get product of all colors

πŸ›‘ Be careful though! CROSS JOIN can be very expensive, especially when the tables are huge.

Example:
If the user table has 100 records, and date table has 365 records, the result of π˜Ύπ™π™Šπ™Žπ™Ž π™…π™Šπ™„π™‰ is a table of of all users for all the dates (100x365 = 36500 records)

πŸ‘‡ If you're confused, the example below might clarify better. Check it out!