Get started
Load & manage data
Work with data
Administration
Reference & resources
CLUSTER BY
mask
ROW FILTER
Updated Jul 26, 2024
Send us feedback
instr
Applies to: Databricks SQL Databricks Runtime
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