当前位置:网站首页>MySQL fuzzy query can use INSTR instead of LIKE
MySQL fuzzy query can use INSTR instead of LIKE
2022-07-31 04:12:00 【Dripping water can hide the sea】
The NSTR() function returns the position of the first occurrence of a substring in a string.The INSTR() function returns zero (0) if the substring is not found in str.
The syntax of the INSTR function is described below.
INSTR(str,substr);The INSTR function accepts two parameters:
str is the string to search for.
substr is the substring to search for.
MySQL INSTR function example
The following statement returns the position of the substring SQL in the MySQL INSTR string.
SELECT INSTR('MySQL INSTR', 'SQL');Execute the above query and get the following results:
mysql> SELECT INSTR('MySQL INSTR', 'SQL');+--------------------------------------------+| INSTR('MySQL INSTR', 'SQL') |+--------------------------------------------+| 3 |+--------------------------------------------+1 row in setExample 2
SELECT * FROM sys_user where INSTR(name, 'a' )>0Finds users whose username contains a, similar to LIKE '%a%'.
Discover other blogs (not written by the author):
Mysql's instr() function usage
边栏推荐
- Daily practice of LeetCode - palindrome structure of OR36 linked list
- The BP neural network
- [C language] General method for finding the sum of the greatest common factor and the least common multiple of two integers m and n, the classical solution
- 识Flutter 基本组件之showTimePicker 方法
- LocalDate addition and subtraction operations and comparison size
- Redis 使用 sorted set 做最新评论缓存
- 手把手实现图片预览插件(三)
- Win10 CUDA CUDNN 安装配置(torch paddlepaddle)
- BUG destroyer!!Practical debugging skills are super comprehensive
- 日志级别 和 打印log注意
猜你喜欢

MySQL based operations

已解决(最新版selenium框架元素定位报错)NameError: name ‘By‘ is not defined

MySQL数据库必会的增删查改操作(CRUD)

Know the showTimePicker method of the basic components of Flutter

Daily practice of LeetCode - palindrome structure of OR36 linked list

IDEA common shortcut keys and plug-ins

Web container and IIS --- Middleware penetration method 1

识Flutter 基本组件之showTimePicker 方法

浅识Flutter 基本组件之CheckBox组件

ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法
随机推荐
浅识Flutter 基本组件之CheckboxListTile组件
手把手实现图片预览插件(三)
The idea project obviously has dependencies, but the file is not displayed, Cannot resolve symbol 'XXX'
安全20220722
The use of beforeDestroy and destroyed
MySQL数据库必会的增删查改操作(CRUD)
interprocess communication
安全20220709
Postgresql 15 source code analysis (5) - pg_control
【C语言进阶】文件操作(一)
$parent/$children 与 ref
Zotero如何删除自动生成的标签
(5) final, abstract class, interface, inner class
Mysql 45 study notes (twenty-five) MYSQL guarantees high availability
MySQL 8.0.30 GA
Win10 CUDA CUDNN installation configuration (torch paddlepaddle)
三子棋的代码实现
postgresql 15源码浅析(5)—— pg_control
组件传值 provide/inject
Redis 使用LIST做最新评论缓存