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

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

你可能感兴趣的:(sql)