操作的排序规则的非法混合 'concat'来自 mysql [英] Illegal mix of collations for operation 'concat' from mysql

查看:66
本文介绍了操作的排序规则的非法混合 'concat'来自 mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自 mysql 的操作 'concat' 的排序规则的非法混合.

Illegal mix of collations for operation 'concat' from mysql.

select (select case when e._type='Call Log' then concat(d.firstname,' ',d.lastname,' ','Scheduled a Call On',' ',
e.logdate)
 when e._type='Meeting' then concat(d.firstname,' ',d.lastname,' ','Scheduled a Meeting  On', ' ',
 e.logdate) when e._type='Mail Log' then concat(d.firstname,' ',d.lastname,' ','Scheduled Mail On',' ',
 e.logdate) end  from schedulelog e where e.log_gid=a.log_gid) from log a
inner join employee b on a.log_by=b.user_gid
 inner join user d on a.log_by=d.user_gid;

这是我的创建表查询

 `CREATE TABLE  `schedulelog` ( `log_gid` varchar(64) NOT NULL,  `bank_gid` varchar(64) default NULL,`logdate` date default NULL,      `_type` varchar(32) default NULL,`log_gid` varchar(64) default NULL,
  `status_flag` varchar(1) default NULL, `schedule_time` varchar(32) default NULL,`followup_type` varchar(64) default NULL,`product_gid` varchar(64) default NULL, `assign_to` varchar(64) default NULL,
  PRIMARY KEY  (`log_gid`), KEY `Index_2` (`bank_gid`),    
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AVG_ROW_LENGTH=2730;`

推荐答案

在您的情况下,您尝试在非字符串类型 (Date/Time/Int) 字段上使用字符串类型 (varchar/text) 集合,并且您收到此错误.你需要做的是看看你在你的条件中在哪里使用这些 noneString 字段,然后把它们像这样放置.

In your condition you try to use a string type (varchar/text) collection on noneString types (Date/Time/Int) fields and you get this error. What you have to do is see where you use these noneString fields in your condition and put them like this.

WHERE (CONVERT(`Here coms the name of the column` USING utf8)

这篇关于操作的排序规则的非法混合 'concat'来自 mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆