Advertisement
Guest User

Untitled

a guest
May 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT p1.PLAYERID,
  2.        f1.PLAYERNAME,
  3.        p2.PLAYERID,
  4.        f2.PLAYERNAME
  5. FROM   PLAYER f1,
  6.        PLAYER f2,
  7.        PLAYS p1
  8.        FULL OUTER JOIN PLAYS p2
  9.                     ON p1.PLAYERID < p2.PLAYERID
  10.                        AND p1.TEAMID = p2.TEAMID
  11. GROUP  BY p1.PLAYERID,
  12.           f1.PLAYERID,
  13.           p2.PLAYERID,
  14.           f2.PLAYERID
  15. HAVING Count(p1.PLAYERID) = Count(*)
  16.        AND Count(p2.PLAYERID) = Count(*)
  17.        AND p1.PLAYERID = f1.PLAYERID
  18.        AND p2.PLAYERID = f2.PLAYERID;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement