我必须从 SQL 运行查询。也许太容易了,但不幸的是我不懂SQL。所以这是我的表:
电影
id | movie_name
------------
1 | prometheus
名字
id | person_name
-----------------
1 | Ridley Scott
2 | Noomi Rapace
3 | Michael Fassbender
4 | Charlize Theron
5 | Damon Lindelof
电影演员
id | film_id | person_id | type
-------------------------------
1 | 1 | 1 | director
2 | 1 | 2 | actor
3 | 1 | 3 | actor
4 | 1 | 4 | actor
5 | 1 | 5 | writer
我怎样才能从这些表中得出这样的结论:
电影档案
id | movie_name | director | writer | cast
---------------------------------------------------------------------------------------
1 | prometheus | Ridley Scott | Damon Lindelof | Noomi Rapace, Michael Fassbender, Charlize Theron
谢谢!