I want to write a query statement in MYSQL to query the query statement containing % (percentage) in the name attribute in the customer table. Which of the following statements can I tell you how to write? Thank you for your urgent use !!!
Example: select * from customer where name like 'wang % ';
Mysql like statement wildcard
MySQL provides standard SQL mode matching and an extended regular expression mode matching format based on Unix utilities such as vi, grep, and sed.
_ Represents a character, while % Represents 0 to any character
If your query statement contains special characters such as %, either/% or [%] can be
Escape Character
Like '5 [%] 'indicates 5%
Like '5% 'indicates 5 followed by 0 and more characters
Like '[_] H' indicates-n
Like '_ n' indicates an, bn, on (and so on)
Like '[a-cdf]' indicates a, B, c, d, or f
Like '[-acdf]' indicates-, a, c, d, or f
Like '[[]' indicates [
Like ']' indicates]
Ii. instance description:
In the PersonalMember table, find the record containing "[" in the strloginname field.
Three statements are available:
1,
Select strloginname, * from PersonalMember where strloginname like '% [% 'escape''
2. (description "" and "/" can be combined with the escape keyword as escape characters)
Select strloginname, * from PersonalMember where strloginname like '%/[% 'escape '/'
3,
Select strloginname, * from dbo. PersonalMember where charindex ('[', strloginname)> 0
---------------------------
Microsoft Internet Explorer --------------------------