REPLACE()
Anonymous contributor
Published Oct 1, 2024
Contribute to Docs
The REPLACE()
function replaces all matching parts of a string with a specified new substring.
Syntax
REPLACE("string_expression", "old_substring", "new_substring");
The REPLACE()
function searches for all occurrences of the old_substring
in the string_expression
and replaces it with new_substring
.
Note: All parameters are required.
Example
In this example, “cool” is replaced with “amazing”:
SELECT REPLACE("SQL is cool", "cool", "amazing");
The above query will give the following output:
SQL is amazing
All contributors
- Anonymous contributor
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.