So I'm trying to display the titles where the number of actresses are 91, and from what I understood, LIMIT 1
should limit the number of ROWS to 1. But here, I'm actually getting 2 titles back that both have 91 actresses playing in it. Why does LIMIT 1 not limit the number of rows to 1 here?
Thanks in advance!
SELECT title, COUNT(*) c
FROM title_100k AS T
JOIN cast_info_100k AS CI ON CI.movie_id = T.id
JOIN role_type AS R ON R.id = CI.role_id
WHERE R.id = 2
GROUP BY(t.id))
SELECT title FROM tempTable WHERE c IN
(SELECT c from tempTable
EXCEPT SELECT c from tempTable WHERE c IN (SELECT c from tempTable WHERE c > 91) ORDER By c desc LIMIT 1);```