1. <legend id='cCzbh'><style id='cCzbh'><dir id='cCzbh'><q id='cCzbh'></q></dir></style></legend>
    2. <small id='cCzbh'></small><noframes id='cCzbh'>

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

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

        MySQL - 如果它以数字或特殊字符开头

        MySQL - If It Starts With A Number Or Special Character(MySQL - 如果它以数字或特殊字符开头)
      1. <legend id='e74SI'><style id='e74SI'><dir id='e74SI'><q id='e74SI'></q></dir></style></legend>

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

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

                  <tfoot id='e74SI'></tfoot>

                    <tbody id='e74SI'></tbody>

                  本文介绍了MySQL - 如果它以数字或特殊字符开头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  SELECT *从`线程`论坛 ID 不在 (1,2,3) 和 IF( LEFT( title, 1) = '#', 1, 0) 中按标题 ASC 排序

                  我有这个查询,如果它以# 开头,它将选择某些内容.我想要做的是,如果 # 作为一个值给出,它将查找数字和特殊字符.或者任何不是普通字母的东西.

                  我该怎么做?

                  解决方案

                  如果要选择所有标题"不以字母开头的行,请使用 REGEXP:

                   SELECT *从线程论坛 ID 不在的地方 (1,2,3)和标题不是正则表达式 '^[[[:alpha:]]'按标题 ASC 排序

                  • NOT 的意思是不"(显然 ;))
                  • ^ 表示以"开头
                  • [[:alpha:]] 表示仅限字母字符"

                  在 MySQL 手册中查找有关 REGEXP 的更多信息.>

                  SELECT * 
                  FROM `thread` 
                  WHERE forumid NOT IN (1,2,3) AND IF( LEFT( title, 1) = '#', 1, 0)
                  ORDER BY title ASC
                  

                  I have this query which will select something if it starts with a #. What I want to do is if # is given as a value it will look for numbers and special characters. Or anything that is not a normal letter.

                  How would I do this?

                  解决方案

                  If you want to select all the rows whose "title" does not begin with a letter, use REGEXP:

                    SELECT * 
                      FROM thread 
                     WHERE forumid NOT IN (1,2,3)
                       AND title NOT REGEXP '^[[:alpha:]]'
                  ORDER BY title ASC
                  

                  • NOT means "not" (obviously ;))
                  • ^ means "starts with"
                  • [[:alpha:]] means "alphabetic characters only"

                  Find more about REGEXP in MySQL's manual.

                  这篇关于MySQL - 如果它以数字或特殊字符开头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Building a comma separated list?(建立一个逗号分隔的列表?)
                  Errors in SQL Server while importing CSV file despite varchar(MAX) being used for each column(尽管每列都使用了 varchar(MAX),但在导入 CSV 文件时 SQL Server 中出现错误)
                  How to update a record using sequelize for node?(如何使用节点的 sequelize 更新记录?)
                  How to provide a mysql database connection in single file in nodejs(如何在 nodejs 中的单个文件中提供 mysql 数据库连接)
                  Defining a one-to-one relationship in SQL Server(在 SQL Server 中定义一对一关系)
                  Looping Over Result Sets in MySQL(在 MySQL 中循环结果集)
                    <tbody id='Q6Jpk'></tbody>
                • <tfoot id='Q6Jpk'></tfoot>

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

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

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

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