• <tfoot id='J44dO'></tfoot>
      <bdo id='J44dO'></bdo><ul id='J44dO'></ul>
    1. <legend id='J44dO'><style id='J44dO'><dir id='J44dO'><q id='J44dO'></q></dir></style></legend>

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

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

        带下划线的 MySQL LIKE 查询

        MySQL LIKE query with underscore(带下划线的 MySQL LIKE 查询)
        1. <legend id='TWkpg'><style id='TWkpg'><dir id='TWkpg'><q id='TWkpg'></q></dir></style></legend>

                <bdo id='TWkpg'></bdo><ul id='TWkpg'></ul>

                1. <small id='TWkpg'></small><noframes id='TWkpg'>

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

                    <tbody id='TWkpg'></tbody>
                  本文介绍了带下划线的 MySQL LIKE 查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有下表images:

                  +----+--------------+
                  | id |   img_path   |
                  +----+--------------+
                  | 1  | abc_1.jpg    |
                  | 2  | abc_2.jpg    |
                  | 3  | abcde_1.jpg  |
                  | 4  | abcde_2.jpg  |
                  | 5  | abcdef_1.jpg |
                  +----+--------------+
                  

                  我想选择img_pathabc_开头的条目,所以我使用以下查询:

                  I would like to select the entries that img_path starts with abc_, so I use the following query:

                  SELECT id FROM images WHERE img_path LIKE 'abc_%'
                  

                  但它返回所有 5 行.我如何只返回 id = 1 &2(哪个img_pathabc_开头)?

                  But it returns all 5 rows. How do I only returns id = 1 & 2 ( which img_path starts with abc_) ?

                  推荐答案

                  发现 _ 是一个特殊字符.必须使用反斜杠转义.

                  Found out that _ is a special character. Have to escape with backslashes.

                  SELECT id FROM images WHERE img_path LIKE 'abc\_%'
                  

                  按预期返回 2 行

                  这篇关于带下划线的 MySQL LIKE 查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  SQL query to group by day(按天分组的 SQL 查询)
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)

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

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

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