我想要一个区分utf8字符的字符集
我希望选择('thanh'='thành')返回0而不是1。
我尝试过utf8_unicode_ci,utf8_general_ci,utf8_bin,utf8_vietnamese_ci。但是所有这些都返回1以进行上述查询。
答案 0 :(得分:1)
你需要使用CAST(...)COLLATE utf8_bin。
<强>查询强>
SELECT CAST('thanh' AS CHAR) COLLATE utf8_bin = CAST('thành' AS CHAR) COLLATE utf8_bin;
<强>结果强>
CAST('thanh' AS CHAR) COLLATE utf8_bin = CAST('thành' AS CHAR) COLLATE utf8_bin
----------------------------------------------------------------------------------
0