Watch the 7.3 Webinar On-Demand
This new release brings updates to Universal Storage, query
optimization, and usability that you won’t want to miss.
Returns the first position of the given search string.
INSTR (str, searchstr)
str
: any string or binary objectsearchstr
: string to search forInteger position, one-indexed. 0 if not found.
SELECT INSTR('ohai', 'i');
+--------------------+
| INSTR('ohai', 'i') |
+--------------------+
| 4 |
+--------------------+
sELECT INSTR('ohai', 'z');
+--------------------+
| INSTR('ohai', 'z') |
+--------------------+
| 0 |
+--------------------+