Files
doris/docs/en/sql-manual/sql-functions/string-functions/instr.md
jiafeng.zhang 267e8b67c2 [refactor][doc]The new version of the document is online (#9272)
replace the `docs/` with `new-docs/`
2022-04-28 15:22:34 +08:00

1.3 KiB

title, language
title language
instr en

instr

Description

Syntax

INSTR (VARCHAR STR, VARCHAR substrate)

Returns the location where substr first appeared in str (counting from 1). If substr does not appear in str, return 0.

example

mysql> select instr("abc", "b");
+-------------------+
| instr('abc', 'b') |
+-------------------+
|                 2 |
+-------------------+

mysql> select instr("abc", "d");
+-------------------+
| instr('abc', 'd') |
+-------------------+
|                 0 |
+-------------------+

keyword

INSTR