| 23.21.1.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_' |
+------------------------+
| 1 |
+------------------------+
1 row in set (0.00 sec)
mysql>
mysql> SELECT 'ABCDE!' LIKE '%A%C%';
+-----------------------+
| 'ABCDE!' LIKE '%A%C%' |
+-----------------------+
| 1 |
+-----------------------+
1 row in set (0.00 sec)
|
|