I have 2 tables:
users
- id_user
- name
- picture_url
matches
- id_match
- date_match
- id_user_winner
- id_user_loser
The query should bring me the list of matches where users.id_user=3 has been the winner. The catch is that the query should bring the name and picture_url from the winner and the loser at the same time.
The curreny query is:
SELECT u.name, u.picture_url, m.id_user_winner, m.id_user_loser, m.date_match FROM matches AS m
INNER JOIN users AS u ON u.id_user = m.id_user_winner WHERE u.id_user = 3
But that will only get me the name and picture of the winner. I need the name and picture of the loser as well. Any ideas? Thanks!