TRANSLATE

All functions > STRING > TRANSLATE

Replaces characters in a string based on character-to-character mappings.

Syntax

TRANSLATE(expr, from, to)
sql

Arguments

ParameterTypeRequiredDescription
stringVARCHARYesString to transform
from_charsVARCHARYesCharacters to replace
to_charsVARCHARYesCharacters to replace with (parallel mapping to from_chars)

Returns

String with character-level replacements applied

Notes

  • Character-by-character replacement (not substring)
  • Each character in from_chars maps to corresponding character in to_chars
  • If to_chars is shorter, extra from_chars are deleted
  • Order matters: first occurrence in from_chars takes precedence

Examples

Last update at: 2025/10/13 10:23:46