Getting started
User guides
Administration guides
Reference guides
Resources
Updated Aug 10, 2022
Send us feedback
instr
Returns the (1-based) index of the first occurrence of substr in str.
substr
str
instr(str, substr)
str: A STRING expression.
substr: A STRING expression.
A BIGINT.
If substr cannot be found the function returns 0.
> SELECT instr('SparkSQL', 'SQL'); 6 > SELECT instr('SparkSQL', 'R'); 0
locate function
position function