नोट
इस पेज तक पहुँच के लिए प्रमाणन की आवश्यकता होती है. आप साइन इन करने या निर्देशिकाओं को बदलने का प्रयास कर सकते हैं.
इस पेज तक पहुँच के लिए प्रमाणन की आवश्यकता होती है. आप निर्देशिकाओं को बदलने का प्रयास कर सकते हैं.
Applies to:
Databricks SQL
Databricks Runtime
Returns the position of the first occurrence of substr in str after position pos. This function is a synonym for locate function.
Syntax
charindex(substr, str [, pos])
Arguments
substr: A STRING expression.str: A STRING expression.pos: An INTEGER expression.
Returns
An INTEGER.
The specified pos and return value are 1-based.
If pos is omitted, substr is searched from the beginning of str.
If pos is less than 1, the result is 0.
Examples
> SELECT charindex('bar', 'abcbarbar');
4
> SELECT charindex('bar', 'abcbarbar', 5);
7