Reputation: 43
I'm running
UPDATE mytable SET FruitsColumn = REPLACE(FruitsColumn,'apple','')
it works fine and deletes every instance of the word "apple" from my column.
But how would I delete apple, and also other words at the same time?
I tried
UPDATE mytable SET FruitsColumn = REPLACE(FruitsColumn,'apple,orange,strawberry','')
and it wouldnt work
Upvotes: 4
Views: 60
Reputation: 12953
you need to do nested REPLACE calls:
UPDATE mytable SET FruitsColumn =
REPLACE(REPLACE(FruitsColumn,'orange',''),'apple','')
Upvotes: 4