Oracle common character function: Translate. the return value replaces each character in from with the corresponding character in to. If from is longer than to, it is more than to in from.
Oracle common character function: Translate. the return value replaces each character in from with the corresponding character in to. If from is longer than to, it is more than to in from.
Syntax: TRANSLATE (char, from,)
Usage: replace each character in The from statement with the corresponding character in the to statement. If the from statement is longer than the to statement, the strings in the from statement are deleted. One of the three parameters is null, And the return value is also null.
Example:
Select translate ('abcdefga ', 'abc', 'wo') from dual;
Analysis: This statement converts 'abc' in 'abcdefga 'to 'wo'. Because 'A' in 'abc' corresponds to 'w' in 'Wo ', therefore, 'A' in 'abcdefga 'is converted to 'w', while' B 'in 'abc' corresponds to 'O' in 'Wo ', therefore, 'B' in 'abcdefga 'is converted to 'O', and 'C' in 'abc' does not have the corresponding character in 'Wo, delete all 'C' in 'abcdefga;