当前位置:网站首页>MySQL模糊查询可以使用INSTR替代LIKE
MySQL模糊查询可以使用INSTR替代LIKE
2022-07-31 04:10:00 【滴水可藏海】
NSTR()函数返回字符串中子字符串第一次出现的位置。如果在str中找不到子字符串,则INSTR()函数返回零(0)。
下面说明了INSTR函数的语法。
INSTR(str,substr);INSTR函数接受两个参数:
str 是要搜索的字符串。
substr 是要搜索的子字符串。
MySQL INSTR函数示例
以下语句返回MySQL INSTR字符串中的子字符串SQL的位置。
SELECT INSTR('MySQL INSTR', 'SQL');执行上面查询语句,得到以下结果:
mysql> SELECT INSTR('MySQL INSTR', 'SQL');
+-----------------------------+
| INSTR('MySQL INSTR', 'SQL') |
+-----------------------------+
| 3 |
+-----------------------------+
1 row in set例2
SELECT * FROM sys_user where INSTR(name, 'a' )>0查找用户名称name中包含a的用户,作用类似于LIKE ‘%a%’。
发现其他博客(非作者所写):
Mysql的instr()函数用法
边栏推荐
- A brief introduction to the CheckBox component of the basic components of Flutter
- RESTful api接口设计规范
- [Dynamic programming] Maximum sum of consecutive subarrays
- 识Flutter 基本组件之showTimePicker 方法
- Safety 20220712
- Database implements distributed locks
- MySQL基础操作
- What skills do I need to learn to move from manual testing to automated testing?
- No qualifying bean of type 问题
- (树) 最近公共祖先(LCA)
猜你喜欢

(4) Recursion, variable parameters, access modifiers, understanding main method, code block

VS QT - ui does not display newly added members (controls) || code is silent

C language from entry to such as soil, the data store

端口排查步骤-7680端口分析-Dosvc服务

postgresql 15源码浅析(5)—— pg_control

How Zotero removes auto-generated tags

Detailed explanation of TCP and UDP
![[C language] Three-pointed chess (classic solution + list diagram)](/img/64/18ed08b64f9618bbd7f24ee16e6a6f.jpg)
[C language] Three-pointed chess (classic solution + list diagram)

Mysql 45 study notes (twenty-five) MYSQL guarantees high availability

mysql基础知识(二)
随机推荐
Basic knowledge of mysql (2)
Knowledge Distillation 7: Detailed Explanation of Knowledge Distillation Code
type_traits元编程库学习
errno错误码及含义(中文)
MySQL 8.0.30 GA
"A daily practice, happy water problem" 1331. Array serial number conversion
Learning DAVID Database (1)
(4) Recursion, variable parameters, access modifiers, understanding main method, code block
(tree) Last Common Ancestor (LCA)
BUG definition of SonarQube
Port inspection steps - 7680 port analysis - Dosvc service
安全20220722
els block to the right
MySQL基础操作
type_traits metaprogramming library learning
RESTful api接口设计规范
some of my own thoughts
【SemiDrive源码分析】【MailBox核间通信】44 - 基于Mailbox IPCC RPC 实现核间通信(RTOS侧 IPCC_RPC Server 消息接收及回复 原理分析篇)
Pytest电商项目实战(上)
With 7 years of experience, how can functional test engineers improve their abilities step by step?