I think there are two nested queries.
Let this be a lesson to the OP and anyone else who reads this thread: Code formatting is important! Bad formatting makes code difficult to understand.
Back to the original question... In your nested query, you're joining the projects table to the cast table. Why not instead, in your outer query, just join the cast table to the projects table?