Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 1.1 KB

File metadata and controls

24 lines (18 loc) · 1.1 KB
description
Translates the base expression from the source characters/expression to the target characters/expression.

TRANSLATE

Syntax

TRANSLATE(base_expression varchar, source_characters varchar, target_characters varchar) → varchar

  • base_expression: The string to translate.
  • source_characters: A string with all the characters in the base expression that need translating. Each character in this string will be replaced with the corresponding character from the target_characters expression or ommitted from the string if target_characters expression has less characters than the source_characters.
  • target_characters: A string containing all the characters to replace the original characters with.

Examples

{% code title="TRANSLATE example" %}

SELECT TRANSLATE('*a*bX*dYZ*','XYZ*','cef');
-- abcdef

{% endcode %}