开发者社区> 问答> 正文

query for pattern in SQL?

已解决

Which operator is used in query for pattern matching?

展开
收起
1780169608831412 2021-10-02 22:09:32 905 0
2 条回答
写回答
取消 提交回答
  • 网络规划设计师、敏捷专家、CISP、ITSS服务经理、ACA全科目、ACP4项、ACE、CBP、CDSP、CZTP等。拥有 PRINCE2 Foundation/Practitioner、CCSK、ITIL、ISO27001、PMP等多项国际认证。 专利5+、期刊10+、知识产权师。核心期刊审稿人。
    采纳回答

    Hi, LIKE operator is used for pattern matching, and it can be used as -.

    % – Matches zero or more characters.
    _(Underscore) – Matching exactly one character.
    
    

    Example -.

    Select * from Student where studentname like 'a%'
    Select * from Student where studentname like 'ami_'
    
    2021-10-02 22:17:31
    赞同 展开评论 打赏
  • mysql> select * from books where name like "x%";
    +------+--------+------+------+
    | name | author | jb   | id   |
    +------+--------+------+------+
    | xig  | sdds   | NULL | NULL |
    +------+--------+------+------+
    1 row in set (0.00 sec)
    
    2021-10-16 19:02:11
    赞同 展开评论 打赏
问答分类:
SQL
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
SQL Server 2017 立即下载
GeoMesa on Spark SQL 立即下载
原生SQL on Hadoop引擎- Apache HAWQ 2.x最新技术解密malili 立即下载