✘ CROSS JOIN in SQL
Last Updated: January 2026
The CROSS JOIN returns the Cartesian Product of two tables. Every row from table A is combined with every row from table B.
If:
- Table A has m rows
- Table B has n rows
Result = m x n rows
Hinglish Tip 🗣: Har row ka har row ke saath combination chahiye → CROSS JOIN.
🧾 Basic Syntax
SELECT columns
FROM table1
CROSS JOIN table2;
Notes:
- No ON condition
- No matching logic
📄 Example Tables
colors
sizes
📄 CROSS JOIN Example
SELECT c.color, s.size
FROM colors c
CROSS JOIN sizes s;
Result
Total rows = 2 x 3 = 6
⚠️ DANGER: Use Carefully
- Large tables → huge result
- Performance issues
- Memory explosion
