Snowflake Vs MS-SQL - Part 55 - POSITION
POSITION
If you want to search for a single character or group of characters in another string.
------------------------------------+------------+
Available_String | Position_1 |
------------------------------------+------------+
nevermore1, nevermore2, nevermore3.| 1 |
-----------------------------------+------------+
In this case, we want to search "nevermore" in the string "nevermore1, nevermore2, nevermore3.". It should return the position as 1.
MS-SQL Server
We can achieve this by using the CHARINDEX() as below.
In Snowflake, we can use a similar approach, which is REGEXP_INSTR().
There is one more function POSITION().
Yogesh Shinde
Comments
Post a Comment