replace({str}, {old_str}, {new_str})

Replaces all occurrences in string str of a substring old_str with a new substring new_str. Returns a new string.

Example

This example replaces instances of 'Al' with 'AL' in the City column. The query returns the first five entries.

SELECT replace(City, 'Al', 'AL') as "City"
From "Superstore"
GROUP BY City
LIMIT 5;
City
Aberdeen
Abilene
Akron
ALbuquerque
ALexandria