RLIKE OPERATOR IN MYSQL
In this tutorial, I will show you the use of RLIKE operator in MYSQL.
RLIKE Operator performs a pattern match of a string expression against a pattern. The pattern is supplied as an argument.
SYNTAX :
SELECT COLUMN NAMES FROM
TABLE NAME
WHERE COLUMN NAME RLIKE EXPRESSION;
Here expression is any valid expression;
EXAMPLE :
Query to fetch names which have vowels (i.e., a, e, i, o and u) as both their first and last characters.
SELECT *
FROM (table name)
WHERE name RLIKE '^[aeiouAEIOU].*[aeiouAEIOU]$';
No comments:
Post a Comment