Zkuste tento dotaz:
SELECT m2.movieId
FROM mMoviesGenres m1
INNER JOIN mMoviesGenres m2
ON m1.genreID = m2.genreID
WHERE m1.movieId = 1 AND
m2.movieId <> 1
GROUP BY m2.movieId
HAVING COUNT(*) = (SELECT COUNT(*) FROM mMoviesGenres WHERE movieId = 1)
Aktualizace:
Pokud chcete najít filmy, které jsou podobné alespoň ve dvou žánrech, použijte tento HAVING
klauzule:
HAVING COUNT(*) >= 2