Snowflake Vs MS-SQL - Part 29 - TRANSLATE
TRANSLATE
If there are unwanted characters in the database and you want to replace or remove those unwanted characters.
If you see here, the actual string is "SQL Coding is Fun" but somehow there are unwanted and the string is saved as "SQLx Codiyng is zFun".
We need to remove additional characters x,y & z.
MS-SQL Server
You can achieve this by using REPLACE. But you need to take multiple iterations.
In Snowflake, we can use a similar syntax as above; however, Snowflake provides an alternative TRANSLATE. By using this we can achieve a single iteration.
Comments
Post a Comment