这个查询:
SELECT customer_id, customer_name FROM customers WHERE isActive = '1' ORDER BY customer_name ASC
输出:
+-------------+-----------------------+
| customer_id | customer_name |
+-------------+-----------------------+
| 1 | Äname |
| 2 | Aname |
| 3 | Bname |
+-------------+-----------------------+
为什么即使我有排序规则,它也不对特殊的瑞典字符进行排序utf8_swedish_ci
SHOW TABLE STATUS FROM myDatabase WHERE name = 'customers';
+-------------+----------------------------+
| Name | Engine | Collation |
+-------------+----------------------------+
| customers | MyISAM | utf8_swedish_ci |
+-------------+----------------------------+
我什至尝试将排序规则放在我的查询中:
SELECT * FROM customers WHERE isActive = 1 COLLATE utf8_swedish_ci ORDER BY customer_name ASC
但后来我得到:
Error Code: 1253. COLLATION 'utf8_swedish_ci' is not valid for CHARACTER SET 'binary'