The function REPLACE replaces all occurrences of string2 in string1 with
string3.
SQL Syntax:
|
|
REPLACE( string1, string2,
string3 ) |
Parameters:
|
|
string1
Any character string or binary expression that can contain the
string from string2.
string2
Any character string or binary expression. This
string is searching in string1.
string3
Any character string or binary expression. This string replace
all occurrence of string2.
|
Escape Syntax:
|
|
{fn REPLACE( string1, string2 [,
start] ) } |
Return Type:
|
|
A character string or binary data type depending
the data type of the expression. |
Examples:
SELECT REPLACE( 'Peter Steve Tom', 'Steve', 'Billy' )
Return Values: Peter Billy Tom
see also:
SQL String Functions
INSERT
LOCATE
|