Skip to content

Instantly share code, notes, and snippets.

@gsampath127
Created October 11, 2019 21:06
Show Gist options
  • Save gsampath127/ec6036b8ae197e56584eaee412763178 to your computer and use it in GitHub Desktop.
Save gsampath127/ec6036b8ae197e56584eaee412763178 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