Loading lesson path
Concept visual
Start at both ends
Return the string from the first argument AFTER the characters specified in the second argument are translated into the characters specified in the third argument:
SELECT TRANSLATE('Monday', 'Monday', 'Sunday'); // Results in SundayThe TRANSLATE() function returns the string from the first argument after the characters specified in the second argument are translated into the characters specified in the third argument.
The TRANSLATE() function will return an error if characters and translations have different lengths.string, characters, translations )
Required. The input string characters Required. The characters that should be replaced translations Required. The new characters
SQL Server (starting with 2017)
Return the string from the first argument AFTER the characters specified in the second argument are translated into the characters specified in the third argument:
SELECT TRANSLATE('3*[2+1]/{8-4}', '[]{}', '()()'); // Results in 3*(2+1)/(8-4)❮ SQL Server Functions