Skip to content

Instantly share code, notes, and snippets.

@gideondsouza
Created August 31, 2012 11:15
Show Gist options
  • Save gideondsouza/3551570 to your computer and use it in GitHub Desktop.
Save gideondsouza/3551570 to your computer and use it in GitHub Desktop.
SELECT yr,COUNT(title) FROM
movie JOIN casting ON movie.id=movieid
JOIN actor ON actorid=actor.id
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
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment