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;
Get all unique student pairs.
1SELECT a.name, b.name
2FROM students a
3CROSS JOIN students b
4WHERE a.id < b.id;