Skip to content

Instantly share code, notes, and snippets.

@Morzanne
Created June 3, 2019 09:27
Show Gist options
  • Save Morzanne/5265109c71a78402a2ae197723d6c8bc to your computer and use it in GitHub Desktop.
Save Morzanne/5265109c71a78402a2ae197723d6c8bc to your computer and use it in GitHub Desktop.
SELECT wizard.firstname, wizard.lastname, player.role, team.name FROM player
INNER JOIN team ON team.id = player.team_id
INNER JOIN wizard ON wizard.id = player.wizard_id
ORDER BY team.name, player.role, wizard.lastname, wizard.firstname;
SELECT wizard.firstname, wizard.lastname FROM player
INNER JOIN wizard ON wizard.id = player.wizard_id
WHERE player.role = 'seeker'
ORDER BY wizard.lastname, wizard.firstname;
SELECT wizard.firstname, wizard.lastname FROM player
RIGHT JOIN wizard ON wizard.id = player.wizard_id
WHERE player.role IS NULL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment