25 March 2019 · n-pacha ·       Add to Favorites   Report

TRANSLATE syntax and usage in Snowflake Datawarehouse

To achieve one-to-one translation of each character use TRANSLATE.

Syntax:

TRANSLATE( <subject>, <sourceAlphabet>, <targetAlphabet> )

Example:

To Translate all occurrences of ‘X’ to ‘c’, ‘Y’ to ‘e’, ‘Z’ to ‘f’ and remove ‘❄’ characters:

select translate('❄a❄bX❄dYZ❄','XYZ❄','cef');

Result:

--------------------------------------+
TRANSLATE('❄A❄BX❄DYZ❄','XYZ❄','CEF') |
--------------------------------------+
abcdef |
--------------------------------------+


Read great educational content like this and a lot more !

Members get free exclusive access to content, new courses, and discounts. Signup for a free account to write a post / comment / upvote posts. Creating an account takes less than 5 seconds and you can start earning badges & points too

Copied