Created
March 16, 2009 10:49
-
-
Save clemens/79825 to your computer and use it in GitHub Desktop.
This file contains 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 * FROM locations | |
WHERE ( | |
SELECT COUNT(*) FROM taggings | |
WHERE tag_id IN ( | |
SELECT tags.id FROM tags | |
WHERE tags.name = 'Bar' OR tags.name = 'Restaurant' | |
) AND taggable_type = 'Location' AND taggable_id = locations.id | |
) > 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment