Skip to content
Advertisement

Joining three junction tables

my heads hurt from trying to figure this out!

I have three tables -Players -Teams -Games

Three junction tables with two columns. -player_teams -teams_games -player_games

I need to list all Players who are in a Game (eg: Game_id = 111 from variable) that are not assigned a Team(in this game). i call them orphaned players

Basically get Teams that are in the game, get their Players and reverse match against Games_players. or the other way round i suppose.

i tried for two day no luck!

thanks!

/J p.s after i posted this i got this far but it seems to complex!

Advertisement

Answer

As the game is given, you can just look at the players in the game and the players of the teams in the game:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement