REGEXP:
It is similar to LIKE which is used to fetch data based on regular expression from a table.
Syntax:
SELECT columnname(s) FROM tablename WHERE columnname REGEXP pattern;
Example 1:
SELECT name FROM Employee WHERE name REGEXP 'sh$';
This query will find those names from Employee table who are ending with "sh". Like it will fetch name like Mahesh , Avnish etc.
Example 2:
SELECT name FROM Employee WHERE name REGEXP 'am';
This query will find those names from Employee table who contains "am" like Amit , Abraham etc.
0 Comment(s)