Home  >  Article  >  Database  >  What is the use of RLIKE operator in MySQL?

What is the use of RLIKE operator in MySQL?

王林
王林forward
2023-08-26 10:45:111699browse

What is the use of RLIKE operator in MySQL?

In fact, the RLIKE operator (a synonym for REGEXP) performs pattern matching of a string expression against a pattern.

Syntax

RLIKE Pat_for_match

Here Pat_for_match is a pattern to be matched with the expression.

Example

mysql> Select Id, Name from Student WHERE Name RLIKE 'v$';
+------+--------+
| Id   | Name   |
+------+--------+
| 1    | Gaurav |
| 2    | Aarav  |
| 20   | Gaurav |
+------+--------+
3 rows in set (0.00 sec) 

Here, $ is a wildcard character used with the RLIKE operator, which will find students' names ending with "v".

The above is the detailed content of What is the use of RLIKE operator in MySQL?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete