Created
February 18, 2012 14:25
-
-
Save jpadilla/1859541 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT main_venue.*, | |
COUNT(main_like.id) AS likes | |
FROM main_venue | |
JOIN main_like ON main_like.venue_id = main_venue.id | |
GROUP BY main_venue.id | |
ORDER BY likes DESC | |
LIMIT 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment