- Explore
- Collaborate
- Visualize
- Connect
- Pricing
How to Replace Substrings in PostgreSQL
The replace()
function is used to change all occurrences of a certain substring to a new string. It accepts three parameters - the main string, the substring to be replaced, and the new string to be used.
select replace('This is old, really old', 'old', 'new');
replace
-------------------------
This is new, really new
Real-time SQL collaboration is here
Get started with PopSQL and PostgreSQL in minutes
Previous
Real-time SQL collaboration is here
Get started with PopSQL and PostgreSQL in minutes