// 未分类
sql 分隔逗号
发布 2020-09-28 · 永久链接
省得下次又到处找
``` sql
select distinct substring_index(substring_index(a.m, ','
, b.help_topic_id + 1), ',', -1) m,
a.f
from mm a
join
mysql.help_topic b
on b.help_topic_id < (length(a.m) - length(replace(a.m, ',', '')) + 1)
where type = 2
// m -> 1,2,3
```