总NOOB试图解决此错误。我最近切换了服务器,突然之间曾经正常工作的表/ SQL查询现在显示以下错误: >操作''SQL = SELECT的排序规则(utf8_general_ci,IMPLICIT)和(latin1_swedish_ci,NUMERIC)的非法混合我在表中有一个结构,其中包含TIME字段和INT字段。当我将时间字段数据类型切换为INT而不是TIME时,错误消失了。不幸的是,时间数据也是如此(显示0:00)。SQL查询看起来像:SELECT OverallRank, First, Last, Affiliate, Part1Number, Part1NumberRank, Part2Number, Part2NumberRank, DATE_FORMAT(Part1Time, '%i:%s') as Part1Time, Part1TimeRank, Part3Number, Part3NumberRank, AgeGroupFROM (SELECT First, Last, Affiliate, AgeGroup, Part1Number, Part2Number, Part1Time, Part3Number, Part1NumberRank, Part2NumberRank, Part1TimeRank, Part3NumberRank, (Part1NumberRank + Part2NumberRank + Part1TimeRank + Part3NumberRank) AS Total, @overallrank:=CASE WHEN @total <> (Part1NumberRank + Part2NumberRank + Part1TimeRank + Part3NumberRank) THEN @overallrank+1 ELSE @overallrank+0 END AS OverallRank, @total:=(Part1NumberRank + Part2NumberRank + Part1TimeRank + Part3NumberRank) AS TTL FROM (SELECT @overallrank:=0) overallrank, (SELECT @total:=0) ttl, (SELECT First, Last, Affiliate, AgeGroup, Part1Number, Part2Number, Part1Time, Part3Number, Part1NumberRank, Part2NumberRank, Part1TimeRank, @rank4:=CASE WHEN @Part3Number <> Part3Number THEN @rank4+1 ELSE @rank4+0 END AS Part3NumberRank, @Part3Number:=Part3Number AS P4 FROM (SELECT @rank4:=0) r4, (SELECT @Part3Number:=0) p4, (SELECT First, Last, Affiliate, AgeGroup, Part1Number, Part2Number, Part1Time, Part3Number, Part1NumberRank, Part2NumberRank, @rank3:=CASE WHEN @Part1Time <> Part1Time THEN @rank3+1 ELSE @rank3+0 END AS Part1TimeRank, @Part1Time:=Part1Time AS P3 FROM (SELECT @rank3:=0) r3, (SELECT @Part1Time:=0) p3, (SELECT First, Last, Affiliate, AgeGroup, Part1Number, Part2Number, Part1Time, Part3Number, Part1NumberRank, @rank2:=CASE WHEN @Part2Number <> Part2Number THEN @rank2+1 ELSE @rank2+0 END AS Part2NumberRank, @Part2Number:=Part2Number AS P2 FROM (SELECT @rank2:=0) r2, (SELECT @Part2Number:=0) p2, (SELECT First, Last, Affiliate, AgeGroup, Part1Number, Part2Number, Part1Time, Part3Number, @rank1:=CASE WHEN @Part1Number <> Part1Number THEN @rank1+1 ELSE @rank1+0 END AS Part1NumberRank, @Part1Number:=Part1Number AS P1 FROM (SELECT @rank1:=0) r1, (SELECT @Part1Number:=0) p1, (SELECT * FROM #__results WHERE EventName = '2011EoSummer' AND Gender = {$REQUEST:Gender} AND ({$REQUEST:Age} = 'Overall' OR AgeGroup = {$REQUEST:Age}) ORDER BY Part1Number DESC ) T1 ) T2 ORDER BY Part2Number DESC ) T3 ORDER BY Part1Time ASC ) T4 ORDER BY Part3Number DESC ) T5 ORDER BY Total ASC ) T6任何帮助将不胜感激我试图在我的PHPMyADMIN中运行查询,并得到以下信息:1267-操作''的归类(utf8_general_ci,IMPLICIT)和(latin1_swedish_ci,NUMERIC)的非法混合 (adsbygoogle = window.adsbygoogle || []).push({}); 最佳答案 这是我的托管公司解决的一个问题...这是他们联系后的回复。看来您当前正在使用的数据库默认使用服务器的默认信息。这可能在帐户转移期间或通过php配置发生。我们准备了一个脚本,您可以运行该脚本来快速更改任何数据库的排序规则。有关更多信息,请参见以下内容:http://www.inmotionhosting.com/support/website/databases/how-to-convert-a-database-to-utf-8排序规则更新后,您便应该能够运行查询而不会出现任何错误。 (adsbygoogle = window.adsbygoogle || []).push({}); 09-20 20:26