Add query for the productive directors

Show the movies from directors that appear more than once in the list.
This commit is contained in:
William Carroll 2020-07-26 15:53:07 +01:00
parent 6ca531116f
commit 32e9f7f56d

View file

@ -48,3 +48,18 @@ WHERE isCartoon = true;
SELECT *
FROM Movies
WHERE isCartoon = true AND requiresSubtitles = false;
-- show the movies from the directors that show up on the list more than once.
SELECT *
FROM Movies
WHERE director in (
SELECT director
FROM (
SELECT director, COUNT(*) as num
FROM Movies
GROUP BY director
HAVING num > 1
ORDER BY num DESC
)
)
ORDER BY director, rating DESC, year DESC;