MySQL查询逗号出现次数

MySQL查询逗号出现次数:

其中drafts表中有userId,userId以“1,2,3”格式存储。

select  (length(userId) - length(replace(<span style="font-family: Arial, Helvetica, sans-serif;">userId</span>,',',''))) nums from drafts WHERE <span style="font-family: Arial, Helvetica, sans-serif;">userId </span>is not null;


猜你喜欢

转载自blog.csdn.net/sinat_18755913/article/details/50084955