Created
June 4, 2011 11:48
-
-
Save oleander/1007835 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 movies.title, movies.rating, images.url as poster | |
| FROM movies | |
| INNER JOIN torrents ON torrents.movie_id = movies.id | |
| INNER JOIN trackers ON trackers.id = torrents.tracker_id | |
| LEFT JOIN images ON images.movie_id = movies.id | |
| LEFT JOIN sizes ON sizes.id = images.size_id | |
| WHERE movies.active = 1 AND | |
| trackers.id IN (2, 3, 4, 1) AND | |
| (sizes.name = 'cover' OR images.id IS NULL) | |
| GROUP BY movies.id | |
| ORDER BY movies.rating ASC | |
| LIMIT 52 OFFSET 468 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment