I have a problem with a select.
I try to get a join between 2 tables: Items
and Characters
.
The thing is, I have a third table Items_history
.
I want my select to show ALL items and ALL characters and, if there's a record, that a character had or has an item, show it.
Shortly speaking, I want something like this:
ID | Character
4 |
5 |
10 | Player1
12 | Player1
12 | Player2
13 | Player3
20 | Player2
| Player4
| Player5
My code right now:
SELECT Items.ID, Character.Name
FROM Items_history
RIGHT JOIN Items
ON Items.ID = Items_history.ID
RIGHT JOIN Characters
ON Characters.Name = Items_history.Name;