Adam Pery
Adam Pery

Reputation: 2102

MySQL, Order by column with strings in English and Other language (Hebrew)

I have table with column category_name and data 1,9,A,B,C,א,ב,ג

Data both in english (1,9,A,B,C) and hebrew (א,ב,ג).

How can I order this data Hebrew first and then English ?

SELECT * FROM table ORDER BY category_name ..... ??

Upvotes: 0

Views: 714

Answers (1)

axiac
axiac

Reputation: 72226

You can try a workaround:

SELECT *
FROM table
ORDER BY IF(category_name <= '~', 2, 1) ASC, category_name

If you have categories whose names start with '~' then use another character that is located between ASCII and Hebrew characters in the Unicode list.

Upvotes: 1

Related Questions