TRANSLATE(x,y,z) is a string function that replaces the ith character of the character string y with the ith character of the character string z in the character string x. The character strings y and z must have the same length; x, y, and z are string specifications. Only expressions that have an alphanumeric value as a result are allowed as string specifications.
|
Result of the TRANSLATE(x,y,z) Function |
x is a NULL value |
NULL Value |
y is a NULL value |
x remains unchanged |
SELECT name, TRANSLATE (name,'or','es')
new_name
FROM customer WHERE firstname IS NOT NULL
Each occurrence of the ith letter in the first character string is replaced by the ith letter in the second one.
NAME |
NEW_NAME |
Porter |
Pestes |
Brown |
Bsewn |
Brian |
Bsian |
Griffith |
Gsiffith |
Randolph |
Randelph |
Jackson |
Jacksen |
Doe |
Dee |
Howe |
Hewe |
Miller |
Milles |
Baker |
Bakes |
Peters |
Petess |
Jenkins |
Jenkins |
See also: