Trying to create a SQL Server query based on a challenge match system. There are two tables that I want to join in the query: Users
and ChallengeMatches
.
The columns in the Users
table are UserID, UserDisplayName
The columns in the ChallengeMatch
table are ChallengeMatchID, ChallengerUserID, ChallengeeUserID
Of course, all ChallengeeUserID
's and ChallengerUserID
's are listed in the Users
table as unique users. What I want the query to do is for each challenge match (row in the ChallengeMatch
table), return the UserDisplayName
of both of the challenge participants e.g. PlayerName1
, PlayerName2
.
Any help would be appreciated.