View Single Post
Old 09-16-2021, 01:07 PM  
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,127
Quote:
Originally Posted by k0nr4d View Post
Your description is kind of odd but I think you are looking for CONCAT.

SELECT CONCAT(`animal`,'zombie') AS animal FROM pets WHERE `item` = 'dog'

If you mean you want to replace dog, cat, and fish with 'zombie' then
REPLACE(`animal`,'dog','zombie')

If you want to replace multiple, then something like
REPLACE(REPLACE(REPLACE(`animal`,'fish','zombie'), 'cat','zombie'),'dog','zombie')
Thanks, going to lookup CONCAT now. [edit] No, not what I'm wanting, the replace is what I am trying to do but being lazy about it and not having to type out a few hundred individual words to replace with 'zombie' lol

What if there are thousands of rows with different items, say 100 different items plus, is the only way to replace them by using each items value?
Publisher Bucks is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote