In the SQL like statement, for example SELECT * FROM user WHERE username LIKE '%luchi%' SELECT * FROM user WHERE username LIKE '_luchi_',
But when the field to be queried by like contains %, how do we check: At this time, you need to specify that the '%' in the field is not used as a wildcard; test: Here we use this table Before escaping: SELECT * FROM user WHERE username LIKE '%%%'; Here you will find that the three % signs are all treated as wildcards; After escaping: SELECT * FROM user WHERE username LIKE '%1%%' ESCAPE '1'; Query successful Note:
Tips and Suggestions:MySQL wildcards are very useful. This functionality comes at a cost, however: wildcard searches generally take longer to process than the other searches discussed previously. Here are some tips to remember when using wildcards.
This is the end of this article on how to use MySQL like to query fields containing '%' (ESCAPE usage). For more information about MySQL like query %, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Native JS to achieve blinds special effects
>>: Solution to Nginx SSL certificate configuration error
Recently, the client of a project insisted on hav...
The specific upgrade script is as follows: Dynami...
How to delete the container created in Docker 1. ...
Mysql8.0.12 decompression version installation me...
There are two ways to deploy Angular projects wit...
This article uses the "Attribution 4.0 Inter...
Regardless of which version of Ubuntu, installing...
Table of contents Objectives for this period 1. F...
After the server where Docker is located has been...
Select and change: click to display the current v...
Table of contents Preliminary preparation Deploym...
From handicraft design to graphic design to web de...
Transactions in MySQL are automatically committed...
Table of contents Add traffic function to github+...
How to write transparent CSS for images using filt...