mysq Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operati

来源:互联网 发布:win7红警网络进不去 编辑:程序博客网 时间:2024/06/05 13:24

mysql 查询时出现:Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '


解决方案:在等号的另一边加上CONVERT(b.Pid USING utf8) COLLATE utf8_unicode_ci;


如:


select * from table1 a
left join table2 b
on a.userid=CONVERT(b.userid USING utf8) COLLATE utf8_unicode_ci

0 0