Created
November 19, 2013 14:53
-
-
Save SauloSilva/7546508 to your computer and use it in GitHub Desktop.
sql case
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 STRAIGHT_JOIN categories.id, categories.title, categories.game_count, categories.display_order FROM `categories` INNER JOIN `category_namespaces` ON `category_namespaces`.`category_id` = `categories`.`id` WHERE `categories`.`type` IN ('ClickJogos::GameCategory') AND `categories`.`published` = 1 AND (category_namespaces.namespace = 'jgo') ORDER BY | |
CASE | |
WHEN categories.id LIKE '447%' THEN 1 | |
WHEN categories.id LIKE '448%' THEN 2 | |
ELSE 3 | |
END, categories.game_count DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment