Files
doris/docs/documentation/cn/sql-reference/sql-functions/string-functions/starts_with.md
Lishi 89c7234c1c Support starts_with (str, prefix) function (#2813)
Support starts_with function
2020-01-21 14:09:08 +08:00

1.5 KiB

starts_with

description

Syntax

BOOLEAN STARTS_WITH (VARCHAR str, VARCHAR prefix)

如果字符串以指定前缀开头,返回true。否则,返回false。任意参数为NULL,返回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 |
+-------------------------------------+

##keyword STARTS_WITH