当前位置:网站首页>About the writing method of SQL field "this includes" and "included in" strings
About the writing method of SQL field "this includes" and "included in" strings
2022-07-05 21:43:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack , I've prepared for you today Idea Registration code .
1、 Field lookup table values “ This includes ” Method a string of all records
If there is one in the table name site , Inquire about name This includes “ Joe – Smith. ” All records . Be able to write sql:
Stirng strsql=”SELECT * FROM Table name WHERE name LIKE ’%”+” Zhang San ”+”%’”;
2、 Query the value of a field “ Included in ” The method of all records of a string
Suppose the query table name Fields are included in the string “ Zhang San is a good student ” All the records of , Can write like this sql:
String strsql=”SELECT * FROM Table name WHERE INSTR(’ Zhang San is a good student ’,name)>0″;
You can check . In record name The field value contains : Zhang 、 3、 ... and 、 yes 、 individual 、 good 、 learn 、 raw 、 Zhang San 、…… All records .
Be careful : above sql Please read the half width full angle symbol carefully .
Copyright notice : This article is an original blog article , Blog , Without consent , Shall not be reproduced .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/117578.html Link to the original text :https://javaforall.cn
边栏推荐
- Zhang Lijun: penetrating uncertainty depends on four "invariants"
- MATLAB | App Designer·我用MATLAB制作了一款LATEX公式实时编辑器
- Opérations de lecture et d'écriture pour easyexcel
- 华为联机对战如何提升玩家匹配成功几率
- 阿里云有奖体验:用PolarDB-X搭建一个高可用系统
- Defect detection - Halcon surface scratch detection
- Scenario interview: ten questions and ten answers about distributed locks
- Golang (1) | from environmental preparation to quick start
- Realize the function of verifying whether the user has completed login when browsing the page
- What should I do to prepare for the interview algorithm position during school recruitment?
猜你喜欢
冯唐“春风十里不如你”数字藏品,7月8日登录希壤!
Access Zadig self-test environment outside the cluster based on ingress controller (best practice)
Simple interest mode - evil Chinese style
Analysis and test of ModbusRTU communication protocol
EasyExcel的读写操作
Oracle检查点队列–实例崩溃恢复原理剖析
An exception occurred in Huawei game multimedia calling the room switching method internal system error Reason:90000017
Recursive query of multi-level menu data
MMAP
Comprehensive optimization of event R & D workflow | Erda version 2.2 comes as "7"
随机推荐
crm创建基于fetch自己的自定义报告
大约SQL现场“这包括”与“包括在”字符串的写法
Summary of data analysis steps
postgis 安装地理信息扩展
Incentive mechanism of Ethereum eth
JMeter installation under win7
oracle 控制文件的多路复用
Get JS of the previous day (timestamp conversion)
MMAP
Experienced inductance manufacturers tell you what makes the inductance noisy. Inductance noise is a common inductance fault. If the used inductance makes noise, you don't have to worry. You just need
华为快游戏调用登录接口失败,返回错误码 -1
Kingbasees v8r3 cluster maintenance case -- online addition of standby database management node
Huawei fast game failed to call the login interface, and returned error code -1
Poj3414广泛搜索
selenium 查找b或p标签的内容
Drawing HSV color wheel with MATLAB
第05章_存储引擎
854. 相似度为 K 的字符串 BFS
基于 Ingress Controller 在集群外访问 Zadig 自测环境(最佳实践)
Deployment of Jenkins under win7