Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create custom MySQL Collation

can you help to create custom mysql collation?

table will contain mix of data in cyrillic and latin characters. some of data will start as a numbers.

i need to have listed (and sorted):

  1. all cyrillic goes first
  2. than all data with latin characters
  3. at the end data that starts with a letter.

is possible to achieve it in mysql at all?

thank you in advance!!!

like image 893
user198003 Avatar asked Nov 05 '22 06:11

user198003


1 Answers

The MySQL dev site gives the steps for adding a new collation. Based on your description, it would seem you could define the rules without a rebuild. If the rules are more complex, it could still be done but would be a lot more effort since it would be necessary to add the C functions for the comparisons and to rebuild MySQL

like image 139
Mark Wilkins Avatar answered Nov 11 '22 04:11

Mark Wilkins