expr LIKE pat [ESCAPE 'escape_char'] : LIKE : String Functions MySQL TUTORIALS


MySQL TUTORIALS » String Functions » LIKE »

 

expr LIKE pat [ESCAPE 'escape_char']


Pattern matching using SQL simple regular expression comparison.

Returns 1 (TRUE) or 0 (FALSE). If either expr or pat is NULL, the result is NULL.

With LIKE you can use the following two wildcard characters in the pattern:

Character Description
% Matches any number of characters, even zero characters
_ Matches exactly one character


mysql>
mysql> SELECT 'ABCDE!' LIKE 'ABCDE_';
+------------------------+
'ABCDE!' LIKE 'ABCDE_' |
+------------------------+
|                      |
+------------------------+
row in set (0.00 sec)

mysql>
mysql> SELECT 'ABCDE!' LIKE '%A%C%';
+-----------------------+
'ABCDE!' LIKE '%A%C%' |
+-----------------------+
|                     |
+-----------------------+
row in set (0.00 sec)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo String Functions
» LIKE