I'm having following problem with mysql query.
Given 2 tables
Person
Id | Name
1 | John Doe
2 | Jane Doe
3 | Pluto
Tickets
Id | Owner | Opener | AssignedTo
1 | 1 | 2 | 3
2 | 3 | 1 | 2
Owner, Opener, AssignedTo are Foreign keys linking to People Id
I need to make a query replacing Owner, Opener, AssignedTo columns with user names.
It's not a problem with just one column (it's enough to use left join), but I can't receive following output
select * from ....
1 | John Doe | Jane Doe | Pluto
2 | Pluto | John Doe | Jane Doe
Thanks in advance.