programming-examples/sql/SQLMovieDatabase/41. Write a query in SQL to find the name of those movies where one or more actors acted in two or more movies.sql
2019-11-18 14:05:53 +01:00

13 lines
418 B
SQL

/*41. Write a query in SQL to find the name of those movies where one or more actors acted in two or more movies. */
SELECT mov_title
FROM movie
WHERE mov_id IN (
SELECT mov_id
FROM movie_cast
WHERE act_id IN (
SELECT act_id
FROM actor
WHERE act_id IN (
SELECT act_id
FROM movie_cast GROUP BY act_id
HAVING COUNT(act_id)>1)));