利用help_topic表把字符串转换成行(分隔符号',')
select substring_index(substring_index('a,b,c,d,e,f,g,h',',',`help_topic_id`+1),',',-1) as `id` from mysql.`help_topic`;
统计字符串每个子串出现次数(分隔符号',')
select substring_index(substring_index(a.`column`,',',b.`help_topic_id` + 1),',',-1) as `sub_column`,count(a.`column`) as `count` from `test` a join mysql.`help_topic` b on b.`help_topic_id` < (length(a.`column`) - length(replace(a.`column`,',',''))+1) group by substring_index(substring_index(a.`column`,',',b.`help_topic_id` + 1),',',-1);
如对本文有疑问, 点击进行留言回复!!
在Ubuntu/Linux环境下使用MySQL开放/修改3306端口和开放访问权限
ORM框架Peewee(高级连接)peewee连接池、主从、重连、ssh连接
记一次Mysql主从复制延迟,Waiting for dependent transaction to commit
网友评论