Can MySQL replace multiple characters?

前端 未结 6 2086
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-27 05:42

I\'m trying to replace a bunch of characters in a MySQL field. I know the REPLACE function but that only replaces one string at a time. I can\'t see any appropriate function

6条回答
  •  北荒
    北荒 (楼主)
    2020-11-27 06:08

    Cascading is the only simple and straight-forward solution to mysql for multiple character replacement.

    UPDATE table1 
    SET column1 = replace(replace(REPLACE(column1, '\r\n', ''), '
    ',''), '<\r>','')

提交回复
热议问题