I am currently completing the More JOIN operations tutorial of sqlzoo and encountered the following code as the answer to #12:
SELECT yr,COUNT(title)
FROM movie
JOIN casting
JOIN actor
ON actorid=actor.id AND movie.id=movieid
WHERE name='John Travolta'
GROUP BY yr
HAVING COUNT(title)=
(SELECT MAX(c) FROM
(SELECT yr, COUNT(title) AS c
FROM movie
JOIN casting ON movie.id=movieid
JOIN actor ON actorid=actor.id
WHERE name='John Travolta'
GROUP BY yr) AS t
)
Is there not a more concise way to express this code?