1

I have a field in table in mysql (5.5.49-0+deb7u1-log) database that a series of alphabets & numbers are saved in it in Farsi. I want to order “select query” output in the table, based on these series(field) in this way: From left to write: numbers in red box, then numbers in green box, then an alphabet in blue box, then numbers in orange box & finally an alphabet in the last box.(pic1) pic1

For example:

001/4پ….
001/4چ……..
001/4ل………
001/40الف…
001/40ب……
001/420ب….
002/1الف….
002/20 ب…

To do this, I’ve selected utf8_general_ci for collation field and the list was ordered except alphabets پ, ژ, گ, چ that went to the end of the list; and when I put collation field on utf8_persian_ci , alphabets get ordered properly but numbers get disorder. The output is attached based on utf8_general_ci collations.(utf8_general_ci_pic,utf8_persian_ci_pic) How should I fix this problem??

utf8_general_ci_pic

Sagar Gangwal
  • 7,544
  • 3
  • 24
  • 38
Habibi
  • 11
  • 2
  • May be it will help you: [https://stackoverflow.com/questions/8557172/mysql-order-by-sorting-alphanumeric-correctly](https://stackoverflow.com/questions/8557172/mysql-order-by-sorting-alphanumeric-correctly) – MVG1984 Jul 19 '17 at 14:07
  • 1
    thanks alot for comment . I sort for Persian characters, not Latin – Habibi Jul 22 '17 at 06:05

0 Answers0