Posts

MySQL not sorting swedish characters ÅÄÖ correct [solved]

Problem: When using ORDER BY or GROUP BY, the swedish characters Å,Ä and Ö is sorted as A and O.

Solution: add COLLATE utf8_swedish_ci to your ORDER BY or GROUP BY, for example:

SELECT field1,field2 FROM table1 ORDER BY field1 ASC

should be changed to:

SELECT field1,field2 FROM table1 ORDER BY field1 COLLATE utf8_swedish_ci ASC