MySQL Forums
Forum List  »  General

Replace strings that start and end with certain strings
Posted by: Henry V
Date: January 02, 2024 12:17PM

I need to replace certain string in a table column named "Description" with many rows. One of the descriptions in a row may look like this:


"Apple iPhone 12 64GB for AT&T. Includes battery and USB charging cable, no other accessories. Cosmetic condition: good, with few minor marks or scratches."

I need to replace the string from "Includes" to "acccessories" with another string, so it will look like this:

"Apple iPhone 12 64GB for AT&T. Includes phone only. Cosmetic condition: good, with few minor marks or scratches."

Because the words between "Includes" and "accessories" may be different among the rows so I cannot use an exact phrase to match and replace. The substrings I want to replace alway starts with "Includes" and end with "acccessories" so I must use those words as reference to replace them. Please advise.

Options: ReplyQuote


Subject
Written By
Posted
Replace strings that start and end with certain strings
January 02, 2024 12:17PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.