v.21.1New Features
Function position now supports POSITION(needle IN haystack) syntax for SQL compatibility
Functionpositionnow supportsPOSITION(needle IN haystack)synax for SQL compatibility. This closes #18701. ... #18779 (Jianmei Zhang).
Why it matters
This feature improves SQL compatibility by allowing users to use the standardPOSITION(needle IN haystack) syntax to find the position of a substring within a string, making it easier to migrate or write queries following common SQL standards.How to use it
Use the function in queries asPOSITION(needle IN haystack) to find the first occurrence of the substring needle in the string haystack. For example:SELECT POSITION('abc' IN 'abcdef');