Regexp
Example 1. The query field contains data that is not in English
The code is as follows |
Copy Code |
SELECT * From ' M_user ' WHERE ' Emp_no ' REGEXP ' [^-~] ' =1 |
Column 2. So I can get all the English-free
The code is as follows |
Copy Code |
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
The code is as follows |
Copy Code |
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
code is as follows |
copy code |
select * from [user] WHERE u_name like '% III ' |