Created
June 26, 2014 16:14
-
-
Save tikaszvince/611a6566a0b61107fd9a to your computer and use it in GitHub Desktop.
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 | |
id, name | |
FROM | |
names | |
order by | |
FIELD( | |
( | |
CASE 1 | |
WHEN SUBSTRING(BINARY name 1, 3) = 'Dzs' | |
THEN 'Dzs' | |
WHEN SUBSTRING(BINARY name, 1, 2) IN ('Cs', 'Dz', 'Gy', 'Ly', 'Ny', 'Sz', 'Ty', 'Zs') | |
THEN SUBSTRING(BINARY name, 1, 2) | |
ELSE SUBSTRING(name, 1, 1) END | |
), | |
'A','Á','B', 'C','Cs','D','Dz', 'Dzs', 'E','É','F','G', 'Gy', | |
'H','I','Í','J','K','L', 'Ly','M','N', 'Ny','O','Ó','Ö','Ő', | |
'P','Q','R','S', 'Sz','T', 'Ty','U','Ú','Ü','Ű','V','W','X', | |
'Y','Z', 'Zs' | |
) ASC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment