Skip to content

Instantly share code, notes, and snippets.

@Sandy4321
Forked from gsampath127/unique_comb_3.sql
Created March 6, 2020 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sandy4321/154c2df33524f0861120478f556ea6fa to your computer and use it in GitHub Desktop.
Save Sandy4321/154c2df33524f0861120478f556ea6fa to your computer and use it in GitHub Desktop.
SELECT m.* FROM #matches m
INNER JOIN #matches m1 ON m.fromid = m1.toid AND m.toid = m1.fromid AND m1.fromid <=m1.toid
ORDER BY m.toteam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment