Skip to content

Instantly share code, notes, and snippets.

@Sandy4321
Forked from gsampath127/unique_comb_2.sql
Created March 6, 2020 17:31
Show Gist options
  • Save Sandy4321/7fb2a13c5e610d2f2d2b081f24eaf59a to your computer and use it in GitHub Desktop.
Save Sandy4321/7fb2a13c5e610d2f2d2b081f24eaf59a to your computer and use it in GitHub Desktop.
SELECT t.id fromid,t.Team fromteam,t1.id toid,t1.Team toteam
INTO #matches
FROM #Team t
INNER JOIN #Team t1 ON t.id <> t1.id
SELECT * FROM #matches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment