<legend id='S19Lo'><style id='S19Lo'><dir id='S19Lo'><q id='S19Lo'></q></dir></style></legend>

    <small id='S19Lo'></small><noframes id='S19Lo'>

    1. <tfoot id='S19Lo'></tfoot>

    2. <i id='S19Lo'><tr id='S19Lo'><dt id='S19Lo'><q id='S19Lo'><span id='S19Lo'><b id='S19Lo'><form id='S19Lo'><ins id='S19Lo'></ins><ul id='S19Lo'></ul><sub id='S19Lo'></sub></form><legend id='S19Lo'></legend><bdo id='S19Lo'><pre id='S19Lo'><center id='S19Lo'></center></pre></bdo></b><th id='S19Lo'></th></span></q></dt></tr></i><div id='S19Lo'><tfoot id='S19Lo'></tfoot><dl id='S19Lo'><fieldset id='S19Lo'></fieldset></dl></div>

        • <bdo id='S19Lo'></bdo><ul id='S19Lo'></ul>

        排查“非法混合排序规则"mysql 中的错误

        时间:2023-08-19
      1. <tfoot id='qG9Qb'></tfoot>

          <small id='qG9Qb'></small><noframes id='qG9Qb'>

          <legend id='qG9Qb'><style id='qG9Qb'><dir id='qG9Qb'><q id='qG9Qb'></q></dir></style></legend>

            • <bdo id='qG9Qb'></bdo><ul id='qG9Qb'></ul>

                    <tbody id='qG9Qb'></tbody>
                1. <i id='qG9Qb'><tr id='qG9Qb'><dt id='qG9Qb'><q id='qG9Qb'><span id='qG9Qb'><b id='qG9Qb'><form id='qG9Qb'><ins id='qG9Qb'></ins><ul id='qG9Qb'></ul><sub id='qG9Qb'></sub></form><legend id='qG9Qb'></legend><bdo id='qG9Qb'><pre id='qG9Qb'><center id='qG9Qb'></center></pre></bdo></b><th id='qG9Qb'></th></span></q></dt></tr></i><div id='qG9Qb'><tfoot id='qG9Qb'></tfoot><dl id='qG9Qb'><fieldset id='qG9Qb'></fieldset></dl></div>

                  本文介绍了排查“非法混合排序规则"mysql 中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  尝试通过 MySQL 中的存储过程进行选择时出现以下错误.

                  Am getting the below error when trying to do a select through a stored procedure in MySQL.

                  排序规则 (latin1_general_cs,IMPLICIT) 和 (latin1_general_ci,IMPLICIT) 的非法混合用于操作 '='

                  Illegal mix of collations (latin1_general_cs,IMPLICIT) and (latin1_general_ci,IMPLICIT) for operation '='

                  知道这里可能出了什么问题吗?

                  Any idea on what might be going wrong here?

                  表的排序规则是latin1_general_ci,where子句中列的排序规则是latin1_general_cs.

                  The collation of the table is latin1_general_ci and that of the column in the where clause is latin1_general_cs.

                  推荐答案

                  这通常是由于比较两个不兼容的排序规则的字符串或尝试将不同排序规则的数据选择到组合列中引起的.

                  This is generally caused by comparing two strings of incompatible collation or by attempting to select data of different collation into a combined column.

                  子句 COLLATE 允许您指定查询中使用的排序规则.

                  The clause COLLATE allows you to specify the collation used in the query.

                  例如,以下 WHERE 子句将始终给出您发布的错误:

                  For example, the following WHERE clause will always give the error you posted:

                  WHERE 'A' COLLATE latin1_general_ci = 'A' COLLATE latin1_general_cs
                  

                  您的解决方案是为查询中的两列指定共享排序规则.下面是一个使用 COLLATE 子句的例子:

                  Your solution is to specify a shared collation for the two columns within the query. Here is an example that uses the COLLATE clause:

                  SELECT * FROM table ORDER BY key COLLATE latin1_general_ci;
                  

                  另一种选择是使用 BINARY 运算符:

                  Another option is to use the BINARY operator:

                  BINARY str 是 CAST(str AS BINARY) 的简写.

                  BINARY str is the shorthand for CAST(str AS BINARY).

                  您的解决方案可能如下所示:

                  Your solution might look something like this:

                  SELECT * FROM table WHERE BINARY a = BINARY b;
                  

                  或者,

                  SELECT * FROM table ORDER BY BINARY a;
                  

                  这篇关于排查“非法混合排序规则"mysql 中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:MySQL 错误:没有密钥长度的密钥规范 下一篇:如何从MySQL中的多个表中删除?

                  相关文章

                  最新文章

                  <tfoot id='IWnjM'></tfoot>

                  <small id='IWnjM'></small><noframes id='IWnjM'>

                  <legend id='IWnjM'><style id='IWnjM'><dir id='IWnjM'><q id='IWnjM'></q></dir></style></legend>
                2. <i id='IWnjM'><tr id='IWnjM'><dt id='IWnjM'><q id='IWnjM'><span id='IWnjM'><b id='IWnjM'><form id='IWnjM'><ins id='IWnjM'></ins><ul id='IWnjM'></ul><sub id='IWnjM'></sub></form><legend id='IWnjM'></legend><bdo id='IWnjM'><pre id='IWnjM'><center id='IWnjM'></center></pre></bdo></b><th id='IWnjM'></th></span></q></dt></tr></i><div id='IWnjM'><tfoot id='IWnjM'></tfoot><dl id='IWnjM'><fieldset id='IWnjM'></fieldset></dl></div>

                    • <bdo id='IWnjM'></bdo><ul id='IWnjM'></ul>