Last active
December 25, 2015 13:59
-
-
Save mrbrdo/6987647 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
# AR and Sequel - results in single query, *not* two | |
Artist.where(id: Album.select(:artist_id)) | |
# SELECT artists.* FROM artits WHERE id IN (SELECT artist_id FROM albums) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment