How to do Case a Case Insensitive Replace in PostgreSQL (I'll show you at the end!) | Essential SQL
May 11, 2024
You want to replace all occurrences of a substring with a new substring using PostgreSQL, MySQL, or SQL Server.
More importantly watch until the end if you want to know how do a case insensitive replacement in PostgreSQL.
One Last Thing...
This video is part of my Beginner Learning series. If you're interested in learning SQL subscribe to @Essential SQL and then check out our Intermediate Learner Playlist. Of course, I also encourage you to visit https://www.essentialsql.com to learn even more!
Important links:
Sample PizzaDB: https://github.com/kwenzel1/EssentialSQLSamples/tree/master/PizzaDB
Corresponding Article: https://www.essentialsql.com/replace-using-postgresql/
Source Code:
select * from Product
REPLACE(productname, 'Coke', 'Pepsi')
SELECT productname OriginalProductList,
REPLACE(productname, 'Coke', 'Pepsi') NewProductList
Show More Show Less #Computer Education
