Created
July 21, 2015 21:10
-
-
Save secretrobotron/52973ecd6bbaeddb33ef to your computer and use it in GitHub Desktop.
filter and prioritize by specific country
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 * FROM projects INNER JOIN users ON users.id = projects.user_id WHERE projects.deleted_at IS NULL AND projects.featured = TRUE | |
ORDER BY | |
CASE country | |
WHEN 'CA' THEN 1 | |
ELSE 2 | |
END , projects.created_at DESC LIMIT 50 OFFSET 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment