SQL often use like for fuzzy query, and fuzzy query will use the hundred semicolon "%", underline "_" These wildcard characters, where "%" matches any number of characters, "_" match a single character. If we want to blur the query with wildcard strings, such as "60%", "user_name", you need to escape the wildcard character, there are two ways. As follows:
1. The backslash is an escape character, and the backslash is used to escape the% so that it is no longer a wildcard character. The first% here is a wildcard and the second% is not a wildcard character.
Select percent from score where percent like '%0\% ';
2, this is escaped by the Escape keyword, the character after the specific symbol to escape, where the% after the slash is no longer wildcard characters, before the% of the backslash still play wildcard role.
Select percent from score where percent like '%0/% ' escape '/';
The above is a small series for everyone to talk about the MySQL fuzzy query of the wildcard in the escape of all the content, I hope that we support cloud Habitat Community ~