2011-11-30 111 views
1

查詢:爲什麼會出現此錯誤:對此操作進行操作'='時排序規則(utf8_general_ci,IMPLICIT)和(utf8_bin,NONE)的非法混合?

select *, 
     (@page_path = concat(
      @page_path, 
      chk_v_application_tree.alias 
     )) as path 
from chk_v_application_tree 

[Err] 1267 - Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_bin,NONE) for operation '='

+0

可能重複[MYSQL區分大小寫的搜索utf8_bin字段](http://stackoverflow.com/questions/901066/mysql-case-sensitive-search-for-utf8-bin-field) – ajreal

回答

0

嘗試:

select *, 
     (@page_path = concat(
      CONVERT(@page_path USING utf8) COLLATE utf8_bin, 
      chk_v_application_tree.alias 
     )) as path 
from chk_v_application_tree 

正如你可能不喜歡CONCAT(utf8_general_ci,utf8_bin)在CONCAT功能混合字符集編碼。

相關問題