What is the use of RLIKE operator in MySQL?

MySQLMySQLi Database

Actually, RLIKE operator, a synonym for REGEXP, performs a pattern match of a string expression against a pattern. 

Syntax

RLIKE Pat_for_match

Here Pat_for_match is a pattern which is to be matched against an 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 wildcard used with RLIKE operator which will find the name of the student ending with ‘v’.

raja
Published on 20-Feb-2018 11:40:12
Advertisements