Skip to content

Instantly share code, notes, and snippets.

@voltgister
Created January 24, 2016 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voltgister/2ed3230c686c453af3d2 to your computer and use it in GitHub Desktop.
Save voltgister/2ed3230c686c453af3d2 to your computer and use it in GitHub Desktop.
SELECT pp.name AS place_name, COUNT(*) AS attendee_count
FROM attendees AS a
INNER JOIN public_places AS pp
ON CONTAINS(pp.border, a.loc)
GROUP BY pp.name
ORDER BY attendee_count DESC
LIMIT 3
place_name attendee_count
------------------- --------------
TD Banknorth Garden 786
Fenway Park 512
Agganis Arena 413
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment