starts_with

description

Syntax

BOOLEAN STARTS_WITH(VARCHAR str, VARCHAR prefix)

如果字符串以指定前缀开头,返回true。否则,返回false。任意参数为NULL,返回NULL。

example

  1. MySQL [(none)]> select starts_with("hello world","hello");
  2. +-------------------------------------+
  3. | starts_with('hello world', 'hello') |
  4. +-------------------------------------+
  5. | 1 |
  6. +-------------------------------------+
  7. MySQL [(none)]> select starts_with("hello world","world");
  8. +-------------------------------------+
  9. | starts_with('hello world', 'world') |
  10. +-------------------------------------+
  11. | 0 |
  12. +-------------------------------------+

keywords

  1. STARTS_WITH