当前位置:网站首页>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
边栏推荐
- 基于 Ingress Controller 在集群外访问 Zadig 自测环境(最佳实践)
- Four components of logger
- 2022-07-03-cka- latest feedback from fans
- 怎么利用Tensorflow2进行猫狗分类识别
- Environment configuration problem record
- Realize the function of verifying whether the user has completed login when browsing the page
- 初级软件测试必问面试题
- Alibaba cloud award winning experience: build a highly available system with polardb-x
- Oracle HugePages没有被使用导致服务器很卡的解决方法
- Advantages of robot framework
猜你喜欢
MySQL InnoDB Architecture Principle
Deeply convinced plan X - network protocol basic DNS
MMAP
Ethereum ETH的奖励机制
基于 Ingress Controller 在集群外访问 Zadig 自测环境(最佳实践)
Feng Tang's "spring breeze is not as good as you" digital collection, logged into xirang on July 8!
Golang (1) | from environmental preparation to quick start
R language learning notes
Kingbasees v8r3 cluster maintenance case -- online addition of standby database management node
Li Kou ----- the maximum profit of operating Ferris wheel
随机推荐
Problems encountered in office--
Teach yourself to train pytorch model to Caffe (III)
SQL common syntax records
Advantages of robot framework
第05章_存储引擎
SecureCRT使用提示
An exception occurred in Huawei game multimedia calling the room switching method internal system error Reason:90000017
他们主动布局(autolayout)环境的图像编辑器
Zhang Lijun: penetrating uncertainty depends on four "invariants"
Matlab | app designer · I used Matlab to make a real-time editor of latex formula
Golang (1) | from environmental preparation to quick start
Huawei game multimedia service calls the method of shielding the voice of the specified player, and the error code 3010 is returned
regular expression
华为快游戏调用登录接口失败,返回错误码 -1
Some things make feelings nowhere to put
让开发效率飞速提升的跨端方案
uni-app 蓝牙通信
冯唐“春风十里不如你”数字藏品,7月8日登录希壤!
ESP32
Li Kou ----- the maximum profit of operating Ferris wheel