View Single Post
Old 09-16-2021, 12:50 PM  
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,111
MySQL Data REPLACE Question...

So I know that I can call information from the SQL database and output it and replace certain words using the REPLACE string but, how would I go about replacing everything in a specific column with a word, or set of words, without actually removing that columns data?

Quote:
SELECT animal FROM pets WHERE item=dog REPLACE zombie
How do I replace whatever is in that 'pets' column with the word 'zombie' no matter if its dog, fish, cat, porcupine, etc? There are a bunch of different variations of 'pet'.

Is there something like REPLACE_ALL I can use across the column or can I only replace certain substring occurrences?

[quickedit]

Also, does it matter if the string is numeric or alphanumeric too as far as the command goes?
Publisher Bucks is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote