您的位置:首页 > 博客中心 > 数据库 >

MYSQL问题解决

时间:2022-03-14 15:07

SELECT a.Pid,a.id FROM `user` as b,`reward` as a WHERE b.id=4 and a.Pid = b.Pid;

在执行上面语句是报错:Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation ‘

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

具体sql如下:

SELECT a.Pid,a.id FROM `user` as b,`reward` as a WHERE b.id=4 and a.Pid = CONVERT(b.Pid USING utf8) COLLATE utf8_unicode_ci;


mysql问题解决,布布扣,bubuko.com

热门排行

今日推荐

热门手游