Regexp
Example 1. The query field contains data that is not in English
Copy Code code as follows:
SELECT *
From ' M_user '
WHERE ' Emp_no '
REGEXP ' [^-~] ' =1
Column 2. So I can get all the English-free
Copy Code code as follows:
SELECT *
From table
WHERE Name
Not REGEXP ' [a-za-z0-9]+ '
Of course, in addition to RegExp can also use Find_in_set,like to operate
Find_in_set
How to use Find_in_set () in MySQL, and where to use Find_in_set (), and the F Second World Collation release Ind_in_set () and in () use the difference.
querying table field Pingid = (1,2,3,) in MySQL
Copy Code code as follows:
SELECT * from ' linkinfo ' WHERE ' pingid ' REGEXP ' {ID}, ' and ' pingid ' not REGEXP ' [[: Alnum:]]+{id}, '
Using the above statement, you can query out
Like
In MySQL, the SQL schema defaults to ignoring the case. Some examples are shown below. Note that when you use SQL mode, you cannot use = or! =; use like or not to compare operators.
SELECT field from table WHERE a field like condition
With regard to conditions, SQL provides four matching modes:
1,%: Represents any one or more characters. Can match characters of any type and length.
Like what
Copy Code code as follows:
Code to copy the code as follows
SELECT * FROM [user] WHERE u_name like '% III '