STARTS_WITH
starts_withβ
Descriptionβ
Syntaxβ
BOOLEAN STARTS_WITH(VARCHAR str, VARCHAR prefix)
It returns true if the string starts with the specified prefix, otherwise it returns false. If any parameter is NULL, it returns NULL.
exampleβ
MySQL [(none)]> select starts_with("hello world","hello");
+-------------------------------------+
| starts_with('hello world', 'hello') |
+-------------------------------------+
| 1 |
+-------------------------------------+
MySQL [(none)]> select starts_with("hello world","world");
+-------------------------------------+
| starts_with('hello world', 'world') |
+-------------------------------------+
| 0 |
+-------------------------------------+
keywordsβ
STARTS_WITH