複数のleft join
が必要 s、タイプを条件とします。私はこのようなものだと思います:
SELECT e.*,
COALESCE(h.name, f.name, c.name, r.name) as name
FROM events e LEFT JOIN
holidays h
on h.id = e.reference_id AND
e.topic_type = 'holiday' LEFT JOIN
fundays f
on f.id = e.reference_id AND
e.topic_type = 'funday' LEFT JOIN
cruises c
on c.id = e.reference_id AND
e.topic_type = 'cruise' LEFT JOIN
recruitment r
on f.id = e.reference_id AND
e.topic_type = 'recruitment'
WHERE e.event_id = 1