My table had \'tags\' field like this:
tag1,tag2,tag3
How to remove \',tag2\' including comma using mysql query.
A quick tip:
UPDATE sets SET tags = tags &~ (1 << FIND_IN_SET('tag2', tags) - 1);
Does not work when your set looks like: 'tag1','tag2','tag3'
'tag3' will get lost by this operation
I ended up using a simple double replace:
UPDATE sets SET tags = replace(replace(tags, 'tag2', ''), ',,', '')
The wrapping replace removes left over comma's from replacing just 'tag2', as you can't be sure if your tagg will be the first or last item of the set
regarding the case of tag22 leaving a 2, doing it without leading zero's as the OP did, your bound for trouble anyway