Skip to content

Instantly share code, notes, and snippets.

@oleander
Created March 7, 2011 02:06
Show Gist options
  • Save oleander/857967 to your computer and use it in GitHub Desktop.
Save oleander/857967 to your computer and use it in GitHub Desktop.
SELECT DISTINCT movies.*, images.url as poster FROM `movies` INNER JOIN `images` ON `images`.`movie_id` = `movies`.`id` INNER JOIN `sizes` ON `sizes`.`id` = `images`.`size_id` WHERE `genres`.`id` IN (2, 21) AND (sizes.name = 'mid') GROUP BY movies.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment