MySQL escape Escape means the original semantics of the escape character. The purpose of an escape character is to start a character sequence so that the character sequence starting with the escape character has different semantics than when the character sequence appears alone. In the SQL LIKE statement, for example select * from user where username like '%nihao%',select * from user where username like '_nihao', Among them, % is used as a wildcard to match multiple characters, and _ is used as a wildcard to match only one character. If you really want to search for usernames that contain % _ , you need to stop using them as wildcards. Escape % _ in like, take _ as an example,
#Case 3: Query the employee names whose second character is _ SELECT last_name FROM employees WHERE last_name LIKE '_$_%' ESCAPE '$'; This is the end of this article about the use of MYSQL escape. For more information on the use of MYSQL escape, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Mini Program to implement Token generation and verification
>>: Detailed explanation of the practical use of HTML table layout
If prompted to enter a key, select [I don’t have ...
I am planning to build my own website, so I took ...
The pitfalls 1. Many tutorials on the Internet wr...
System environment: Win10 64-bit MySQL version: m...
Table of contents Overview Environment Preparatio...
Preface When the system space usage is too large ...
What we are simulating now is a master-slave syst...
Today we will implement a fragmented image loadin...
Table of contents background analyze method backg...
Recently, I have been working on several virtual ...
Table of contents Overview Promise Race Method Re...
1. Create the /usr/local/services/zookeeper folde...
Install CentOS 7 after installing VirtualBox. I w...
1. Best left prefix principle - If multiple colum...
mysql-8.0.19-winx64 downloaded from the official ...