MySQL NOT RLIKE operator can be used to check for a pattern that does not exist in an expression. The syntax of NOT RLIKE is as follows -
NOT RLIKE Pat_not_for_match
Here Pat_not_for_match is a pattern that does not match the expression.
mysql> Select Id, Name from Student WHERE Name NOT RLIKE '^H'; +------+---------+ | Id | Name | +------+---------+ | 1 | Gaurav | | 2 | Aarav | | 20 | Gaurav | | 21 | Yashraj | +------+---------+ 4 rows in set (0.00 sec)
The above query finds names from the "student" table that do not have a pattern starting with "H". ^ is a wildcard used with NOT RLIKE to indicate the beginning of a string.
The above is the detailed content of In MySQL, how to check for a non-existent pattern in an expression?. For more information, please follow other related articles on the PHP Chinese website!