当前位置:网站首页>MySQL advanced (VI) introduction to four common uses of fuzzy query
MySQL advanced (VI) introduction to four common uses of fuzzy query
2022-07-19 13:08:00 【InfoQ】
mysql
One 、%
%%
SELECT * FROM [user] WHERE u_name LIKE '% 3、 ... and %';
SELECT * FROM [user] WHERE u_name LIKE '% 3、 ... and %' AND u_name LIKE '% cat %';
SELECT * FROM [user] WHERE u_name LIKE '% 3、 ... and % cat %'
Two 、_
SELECT * FROM [user] WHERE u_name LIKE '_ 3、 ... and _';
SELECT * FROM [user] WHERE u_name LIKE ' 3、 ... and __';
3、 ... and 、[ ]
SELECT * FROM [user] WHERE u_name LIKE '[ Zhang liwang ] 3、 ... and ';
[ ]
SELECT * FROM [user] WHERE u_name LIKE ' The old [1-9]';
Four 、[^ ]
SELECT * FROM [user] WHERE u_name LIKE '[^ Zhang liwang ] 3、 ... and ';
SELECT * FROM [user] WHERE u_name LIKE ' The old [^1-4]';
5、 ... and 、 Query content contains wildcard processing
%
_
[
[ ]
function sqlencode(str)
str=replace(str,"';","';';")
str=replace(str,"[","[[]") ';
str=replace(str,"_","[_]")
str=replace(str,"%","[%]")
sqlencode=str
end function
6、 ... and 、 Expanding reading MySQL Data table with OR Multi criteria query of
OR
OR
- As long as one of these query conditions is met , Such records will be found out .
- If you do not meet any of these query conditions , Such records will be excluded .
Conditional expression 1 OR Conditional expression 2 [...OR Conditional expression n]
6.1 example 1
SELECT * FROM employee WHERE d_id=1001 OR sex LIKE ' male ';
6.2 example 2
SELECT * FROM employee WHERE
num IN(1,2,3) OR age BETWEEN 24 AND 26
OR homeaddress LIK '% Xiamen City %';
OR
AND
6.3 example 3
SELECT * FROM employee WHERE num IN(1,3,4) AND age=25 OR sex=' Woman ';
SELECT
SELECT * FROM employee WHERE sex=' Woman ' OR num IN(1,3,4) AND age=25;
SELECT
AND
OR
AND
OR
=
>
IN
BETWEEN AND
LIKE
LIKE
%
_
边栏推荐
- VMware导入ova/ovf虚拟机文件
- Knowledge sorting of MySQL
- 【Try to Hack】arp和arp欺骗
- 又错了,字节对齐及#pragma pack的使用
- Uio-66 | fe3o4/cu3 (BTC) 2 metal organic framework (MOF) nanocomposites supported on silver nanoparticles | nagdf4:yb, er upconversion nanoparticles @zif-8
- 【Pygame 学习笔记】6.Cursor 鼠标光标
- 最懂你的服装设计师是AI?让用户 “凭心意” 生成数字服装#Adidas OZWORLD
- [C language programming 8] branch predictor
- What are the pain points of collaborative tools collaborative office management
- 整理了一份通用的内存管理驱动代码
猜你喜欢
VMware导入ova/ovf虚拟机文件
Investment logic in market "uncertainty" 2020-03-18
Cloud health management system based on STM32 (using Alibaba cloud Internet of things platform)
Ultrasonic sensor (ch101 & ch201) - Ⅱ
收益风险比:投资机会最重要指标 2020-03-14
MOF customized product | n-k2ti4o9/g-c3n4/uio-66 ternary composite | paper based au-aginse2-zif-8 Nanocomposite
C语言进阶——自定义类型:结构体 枚举 联合
Supported metal organic framework zif-8 / graphene oxide hydrogen storage material | titanium dioxide /zif-8 composite | silicon dioxide @zif8 nano material
Uio-66 | fe3o4/cu3 (BTC) 2 metal organic framework (MOF) nanocomposites supported on silver nanoparticles | nagdf4:yb, er upconversion nanoparticles @zif-8
Li Kou 198-213 looting Ⅰ, Ⅱ - Dynamic Planning
随机推荐
可视化ETL工具Kettle概念、安装及实战案例
C语言进阶——自定义类型:结构体 枚举 联合
力扣64-最小路径和——动态规划入门题型
XML modeling (easy to learn)
力扣413-等差数列划分——动态规划
Differences between get requests and post requests and usage examples
标签球问题
JVM self study summary
力扣198-213 打家劫舍Ⅰ、Ⅱ——动态规划
Google developer community sharing - flutter animation sharing has been released
XML建模(简单易学)
npm err! ant-design- [email protected] build: `umi build`
LeetCode 0117. 填充每个节点的下一个右侧节点指针 II
Nitrogen heterocyclic molecule modified uio-66-nh2 | polyethyleneimine modified uio-66-nh2| [email protected] @Zif67 nanomaterial
[pyGame learning notes] 7 event
收益风险比:投资机会最重要指标 2020-03-14
2022 global developer salary exposure: China ranks 19th, with an average annual salary of $23790
VMware导入ova/ovf虚拟机文件
面试难题:分布式 Session 实现难点,这篇就够!
[try to hack] ARP and ARP deception