SELECT DISTINCT d.first_name, d.last_name, a.first_name, a.last_name
FROM actors a
JOIN roles r1 ON (a.id = r1.actor_id)
JOIN roles r2 ON (a.id = r2.actor_id)
/*
JOIN movies m1 ON (r1.movie_id = m1.id)
JOIN movies m2 ON (r2.movie_id = m2.id)
JOIN movies_directors md1 ON (m1.movie_id = md1.movie_id)
JOIN movies_directors md2 ON (m2.movie_id = md2.movie_id)
*/
JOIN movies_directors md1 ON (r1.movie_id = md1.movie_id)
JOIN movies_directors md2 ON (r2.movie_id = md2.movie_id)
JOIN directors d ON (d.id = md1.director_id AND d.id = md2.director_id)
/*
WHERE r1.movie_id != r2.movie_id;
WHERE m1.movie_id != m2.movie_id;
*/
WHERE md1.movie_id != md2.movie_id;