Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
Applies to:
Databricks SQL
Databricks Runtime
Returns the position of a string within a comma-separated list of strings.
Syntax
find_in_set(searchExpr, sourceExpr)
Arguments
searchExpr: A STRING expression specifying the “word” to be searched.sourceExpr: A STRING expression with commas separating “words”.
Returns
An INTEGER.
The resulting position is 1-based and points to the first letter of the match.
If no match is found for searchExpr in sourceExpr or searchExpr contains a comma, 0 is returned.
Examples
> SELECT find_in_set('ab','abc,b,ab,c,def');
3