TRANSLATE (' char ', ' from_string ', ' to_string ')
Translate returns a string that replaces each character in the from_string with the corresponding character in to_string.
Translate is a superset of the functionality provided by replace. If the from_string is longer than to_string, the extra characters in from_string that are not in to_string are removed from char because they do not have corresponding substitution characters. The to_string cannot be empty. Oracle interprets an empty string as null, and if any argument in translate is null, the result is null.
As an example
Select Translate (' 123abc ', ' 2dc ', ' 4e ') from dual;
Because the position of from_string and To_string is one by one corresponding, 2 corresponds to 4,d e,c no corresponding value, so C should be deleted.
So the example of the word character 2 will be replaced by 4,
D because there is no in the string, so do not replace,
C will be deleted in the string because there is no corresponding substitution character
So it can be concluded that the result is
143ab
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/