`
streammoon
  • 浏览: 25695 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Illegal mix of collations (utf8_general_ci,IMPLICIT) and (gbk_chinese_ci,COERCIB

阅读更多
myeclipse8 + mysql:
其中数据库以及表的编码都是utf-8;

Illegal mix of collations (utf8_general_ci,IMPLICIT) and (gbk_chinese_ci,COERCIBLE) for operation 'UNION'

这是在使用union关联时出现的问题;

解决如下:
在代码中 查询出来的字段上添加 convert( using utf8);如:

select '列值'  as 列名 from  table。。。
换成
select convert('列值' using utf8) as 列名   table。。。

如果有子查询的话 是放在最外层的查询结果上。。。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics