Hey there - I'm trying to make the same join on two different fields in the same record. I have a field "sender" and a field "receiver", both contain user IDs. I want to select with this queary the usernames for both userIDs by joining on the users table, twice.
In effect, I am trying to accomplish the theoretical effect of this non-working snippet:
Any solutions would be most appreciated - Better yet the specific documentation that discusses such an procedure. Thanks in advance!
In effect, I am trying to accomplish the theoretical effect of this non-working snippet:
Code:
SELECT ropasc_games.id,
ropasc_games.sender,
ropasc_games.receiver,
users.username,
users.username
FROM ropasc_games
LEFT JOIN users ON ropasc_games.sender = users.id
LEFT JOIN users ON ropasc_games.receiver = users.id
Any solutions would be most appreciated - Better yet the specific documentation that discusses such an procedure. Thanks in advance!