Skip
Arish's avatar

201. Practice - Self Cartesian


Exercise: All Pairs

Get all unique student pairs.

Solution

sql
1SELECT a.name, b.name
2FROM students a
3CROSS JOIN students b
4WHERE a.id < b.id;