Random sorting in MySQL

Is there any sort type in MySQL that Case Sensitive supports. I had all sort types in MySQL, all of them have _ci at the end of their name, so they are case insensitive. Thank you in advance.

+45
database mysql
Dec 29 '10 at 23:14
source share
3 answers

According to the MySQL manual http://dev.mysql.com/doc/refman/5.0/en/charset-mysql.html you can set the mapping to _cs for case sensitivity. You can get a list of _cs mappings by running the SHOW COLLATION WHERE COLLATION LIKE "%_cs" query




After a little research:

There seems to be no (yet) utf8_*_cs in MySQL. If utf8 fields require case-sensitive sorting, you should use utf8_bin . This will ruin ORDER BY , but it can be fixed with ORDER BY column COLLATE utf8_general_ci

Source: http://forums.mysql.com/read.php?103,19380,200971#msg-200971 and http://forums.mysql.com/read.php?103,156527,198794#msg-198794

+65
Dec 29 '10 at 23:20
source share

Try completing the sort in _bin , for example latin1_bin or utf8_bin , depending on your character set.

+6
Dec 29 '10 at 23:26
source share

The new version of MySQL (8.0.1 and higher) comes (finally) with a set of utf8mb4_*_0900_as_cs collations.

Read more about it here.

0
Oct 11 '17 at 13:50
source share



All Articles