I have a Table "Movie" and a Table "Director". Those are connected by the Table "MovieDirector" with a multiple to multiple relation. The Tables have the following fields:
Movie:
uid
name
release_date
Director:
uid
name
MovieDierector:
uid
movie_id
director_id
I now want a list of all movies with their directors. It is possible, that more than one directors worked on a movie. If this is the case, I want the result to look like this:
movie | release-date | director
movie A | 2011 | director 1, director 2
movie B | 2013 | director 1
movie C | 1999 | director 3
I have tried inner join, left join ,right join in all possible combinations. But I always get this result:
movie | release-date | director
movie A | 2011 | director 1
movie A | 2011 | director 2
movie B | 2013 | director 1
movie C | 1999 | director 3
All that changes with the different join combinations is the ordering of the entries.
Can someone tell me, if this is even possible to achieve with MySQL? If yes, how is it done? And if not how would be the best way to achieve this with multiple SQL requests?