Skip to content

Instantly share code, notes, and snippets.

@kljensen
Created January 23, 2018 16:35
Show Gist options
  • Save kljensen/f272e9cac4b646256624bad3b32a11d2 to your computer and use it in GitHub Desktop.
Save kljensen/f272e9cac4b646256624bad3b32a11d2 to your computer and use it in GitHub Desktop.
SELECT
movies.title,
COUNT(*) as num_reviews
FROM
movies
JOIN
reviews
ON movies.id = reviews.movie_id
WHERE
action = 1
GROUP BY
movies.id
ORDER BY
num_reviews DESC LIMIT 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment