Город МОСКОВСКИЙ
00:06:33

How to do Case a Case Insensitive Replace in PostgreSQL (I'll show you at the end!) | Essential SQL

Аватар
JavaScript для детей
Просмотры:
25
Дата загрузки:
04.12.2023 05:57
Длительность:
00:06:33
Категория:
Технологии и интернет

Описание

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
FROM Product


UPDATE Product
SET productname = REPLACE(productname, 'Coke', 'Pepsi')



REGEXP_REPLACE(productname, 'coke', 'Pepsi','i')

Рекомендуемые видео