nakupanda 发表于 2013-1-25 22:23:13

mysql 不同编码表字段比较时出现 illegal mix of collations

出错语句:
select * from `db1`.`table1` as `table1`,`db2.`table2` as `table2` where `table1`.`username`=`table1`.`username`;


table1和table2使用不同编码,提示illegal mix of collations ..

我的解决办法是
select * from `db1`.`table1` as `table1`,`db2.`table2` as `table2` where encode(`table1`.`username`,'mykey')=encode(`table1`.`username`,'mykey');
页: [1]
查看完整版本: mysql 不同编码表字段比较时出现 illegal mix of collations