我在运行
UPDATE mytable SET FruitsColumn = REPLACE(FruitsColumn,'apple','')
它工作正常并从我的专栏中删除了单词“apple”的每个实例。
但是我怎样才能同时删除 apple 和其他词呢?
我试过了
UPDATE mytable SET FruitsColumn = REPLACE(FruitsColumn,'apple,orange,strawberry','')
那是行不通的
最佳答案
您需要进行嵌套的 REPLACE 调用:
UPDATE mytable SET FruitsColumn =
REPLACE(REPLACE(FruitsColumn,'orange',''),'apple','')
关于mysql - 如何从列中删除多个关键字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34486152/