[英]Update comma separated list in mysql
I am trying to update a comma separated list in mysql. 我正在尝试在mysql中更新逗号分隔的列表。 My query goes like:
我的查询是这样的:
UPDATE courses SET c_subscribers = c_subscribers,129 WHERE NOT FIND_IN_SET (1270, c_subscribers) AND c_id = 129
I am getting an MySql Error: You have an error in your SQL syntax; 我收到一个MySql错误:您的SQL语法有错误; check the manual that corresponds to your MySQL server
检查与您的MySQL服务器相对应的手册
Which i cant figure out why? 我不知道为什么? what am i doing wrong?
我究竟做错了什么?
Try this.... 尝试这个....
UPDATE courses SET c_subscribers = CONCAT(c_subscribers,',129') WHERE NOT FIND_IN_SET (1270, c_subscribers) AND c_id = 129
using CONCAT
function you can update the required value 使用
CONCAT
功能可以更新所需的值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.