I have a movie database that links to an actors database. 1 move = many actors of course but I want to display the actor information along with the movie like so
series_id, name, actors
123 | John Foo, Jay Bar, James Baz
the two tables are linked by actor_id
Here's what I got:
Expand|Select|Wrap|Line Numbers
- mysql> SELECT si.series_id, (SELECT a.full_name FROM actor AS a WHERE a.actor_id = sa.actor_id) AS actors
- -> FROM seriesimage AS si LEFT JOIN seriesactor AS sa ON sa.series_id = si.series_id
- -> WHERE si.series_id = 121428;
- +-----------+--------------------------+
- | series_id | actors |
- +-----------+--------------------------+
- | 121428 | Michael Clarke Duncan |
- | 121428 | NULL |
- | 121428 | The Rock Douglas Johnson |
- +-----------+--------------------------+
Thanks,
Dan