我在mysql中有一个视图“name_all”,它的结构是
colName varchar(30) utf8_general_ci
date varchar(76) utf8_general_ci
name varchar(43) latin1_swedish_ci
当我尝试运行查询时:
SELECT CONCAT(`colname`,' of Mr. ',`name`,' Expire on ',`date`) FROM name_all
它给出错误:
#1271 - Illegal mix of collations for operation 'concat'
"colName" is basically a Column Name which is used as a row in this View
"date" is mysql Date which is converted in this format '%a %D %b, %Y'
"name" is concatenation of firstname, middlename, lastname from a table
我该如何解决这个问题,我的错误是什么?
当我运行查询 SHOW VARIABLES LIKE 'collation%' 结果是
Variable_name Value
collation_connection utf8_general_ci
collation_database latin1_swedish_ci
collation_server latin1_swedish_ci