mysql 向字段添加数据或者删除数据

1 UPDATE table SET cids = CONCAT(cids , ',12')  where id=id  //向字段添加数据
2 //因为要用逗号分隔 所以在在前面加了一个逗号
3 
4 UPDATE table SET cids = replace(cids , ',12' , '')  where id=id //从字段中删除数据
5  //只要把想要删除的数据替换为空就可以了 
posted @ 2020-01-19 12:00  millet_handsome  阅读(619)  评论(0编辑  收藏  举报