[Err] 1271 - Illegal mix of collations for operation 'UNION'

报错原因:当使用union或union all时查询出的字段的排序规则不同。

解决方法:

select  column(列名) collate utf8_unicode_ci(排序规则)from table(表名)
union/union all
select  column(列名) collate utf8_unicode_ci(排序规则)from table(表名);

 

posted @   lightbc  阅读(1588)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示