Mysql remove the specific word in comma seperated string

后端 未结 6 810
温柔的废话
温柔的废话 2020-12-20 03:35

My table had \'tags\' field like this:

Tags

tag1,tag2,tag3

How to remove \',tag2\' including comma using mysql query.

6条回答
  •  渐次进展
    2020-12-20 04:19

    I found a solution, but would love to know if there is an easier way of doing it... SELECT TRIM(BOTH ',' FROM (SELECT REPLACE(REPLACE('tag1,tag2,tag3','tag2',''),',,',',')))

提交回复
热议问题