Created
December 7, 2016 20:39
-
-
Save fotan/abd14c9e62e8e225833cc57acbc5bffc to your computer and use it in GitHub Desktop.
MYSQL - ORDER BY values in a field in your own order
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
ORDER BY FIELD(fieldname, 7, 4, 34); | |
or | |
ORDER BY FIELD(fieldname, 'seven', 'four', 'asshole'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment