мой запрос
У меня есть база данных о фильмах. Каждый фильм имеет несколько продюсеров, актеров и может быть отнесен к нескольким жанрам. Я пытаюсь отобразить всю эту информацию.
Как мне изменить свой запрос, чтобы получить различную информацию, например, от a1.actor_id и a2.actor_id
Воспользуйтесь ссылкой, чтобы увидеть мой база данных на GitHub https://github.com/J4Mary/lesson11/blob/master/films13.sql
SELECT CONCAT(
'Name: "',
films.film_name,
'" (', films.year, '). Rating: ',
films.rating,
' Genre: ',
g1.genre, ', ',
g2.genre, ', ',
g3.genre,
'. Directors: ',
p1.producer_name, ', ',
p2.producer_name,
'. Actors: ',
a1.actor_name, ', ',
a2.actor_name, ', ',
a3.actor_name
) AS info
FROM
films
INNER JOIN s_film_genre ON (films.id_film=s_film_genre.film_id)
INNER JOIN genres AS g1 ON (s_film_genre.genre_id=g1.genre_id)
INNER JOIN genres AS g2 ON (s_film_genre.genre_id=g2.genre_id)
INNER JOIN genres AS g3 ON (s_film_genre.genre_id=g3.genre_id)
INNER JOIN s_film_producer ON (films.id_film=s_film_producer.id_film)
INNER JOIN producers AS p1 ON (s_film_producer.id_producer=p1.id_producer)
INNER JOIN producers AS p2 ON (s_film_producer.id_producer=p2.id_producer)
INNER JOIN s_film_actor ON (films.id_film=s_film_actor.id_film)
INNER JOIN actors AS a1 ON (s_film_actor.id_actor=a1.id_actor)
INNER JOIN actors AS a2 ON (s_film_actor.id_actor=a2.id_actor)
INNER JOIN actors AS a3 ON (s_film_actor.id_actor=a3.id_actor);