0

I have a table with id, surname etc., when I query order by surname I obtain something like this

A, B, C,... V, Z, Ć, Č, Č, Đ ...

where slavian char are ordered after finished western european alphabet

Mysql connection is set in utf-8. query is

SELECT * FROM table ORDER BY SURNAME ASC 

how can i obtain an unique order like

A, B, C, Ć, Č, Č, Đ... V, Z

Thanks

Michał Turczyn
  • 32,028
  • 14
  • 47
  • 69
  • Possible duplicate of [Mysql order by on column with unicode characters](https://stackoverflow.com/questions/18210189/mysql-order-by-on-column-with-unicode-characters) – Nico Haase Jan 28 '19 at 09:15

2 Answers2

0

in this case you need to define your own Alphabet (or Order). To do so you can follow the answer to this question.

Hopefully it works with non-ascii signs.

Shuumi
  • 173
  • 9
0

What you need is to use proper collation, which provides necessary info about ordering strings. Here's how to use collate keyword:

SELECT * FROM table ORDER BY SURNAME COLLATE latin1_german2_ci

Here I used latin1_german2_ci as an example, find collation that matches your requirements.

Supported Character Sets and Collations

Michał Turczyn
  • 32,028
  • 14
  • 47
  • 69