Created
April 17, 2012 09:09
-
-
Save decebal/2404772 to your computer and use it in GitHub Desktop.
Sorting values separately as string or numeric
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 test_col, SUBSTRING_INDEX(test_col, '', 1) as test_col_str, | |
SUBSTRING_INDEX(test_col, ' ', -1) + 0 as test_col_num FROM test ORDER | |
BY test_col_str, test_col_num; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment