<tfoot id='fOrdZ'></tfoot>

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

  2. <small id='fOrdZ'></small><noframes id='fOrdZ'>

    <legend id='fOrdZ'><style id='fOrdZ'><dir id='fOrdZ'><q id='fOrdZ'></q></dir></style></legend>
        <bdo id='fOrdZ'></bdo><ul id='fOrdZ'></ul>

      如何在 MySql 中进行重音敏感搜索

      时间:2023-08-18
        <tbody id='N9Oxo'></tbody>

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

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

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

                <bdo id='N9Oxo'></bdo><ul id='N9Oxo'></ul>
                本文介绍了如何在 MySql 中进行重音敏感搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我有一个带有 utf8 通用 ci 排序规则的 MySQL 表.在表格中,我可以看到两个条目:

                I have a MySQL table with utf8 general ci collation. In the table, I can see two entries:

                糟糕
                废话

                我使用的查询如下所示:

                I am using a query that looks like this:

                SELECT *  FROM `words` WHERE `word` = 'abád'
                

                查询结果给出了两个词:

                The query result gives both words:

                糟糕
                废话

                有没有办法表明我只希望 MySQL 找到带重音的单词?我希望查询只返回

                Is there a way to indicate that I only want MySQL to find the accented word? I want the query to only return

                废话

                我也试过这个查询:

                SELECT *  FROM `words` WHERE BINARY `word` = 'abád'
                

                它没有给我任何结果.谢谢你的帮助.

                It gives me no results. Thank you for the help.

                推荐答案

                如果您对该字段的搜索总是对重音敏感,则将该字段的排序规则声明为 utf8_bin(这将比较 utf8-encoded 字节)或使用特定于语言的排序规则来区分重音字符和非重音字符.

                If your searches on that field are always going to be accent-sensitive, then declare the collation of the field as utf8_bin (that'll compare for equality the utf8-encoded bytes) or use a language specific collation that distinguish between the accented and un-accented characters.

                col_name varchar(10) collate utf8_bin
                

                如果搜索通常不区分重音,但您想为此搜索设置例外,请尝试;

                If searches are normally accent-insensitive, but you want to make an exception for this search, try;

                WHERE col_name = 'abád' collate utf8_bin
                

                这篇关于如何在 MySql 中进行重音敏感搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何在 MySQL 上获取两个日期之间相差的天数? 下一篇:mysql 使用另一个表中的值更新列

                相关文章

                最新文章

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

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