mysql一个字段用逗号分隔,转化为多行_yantaiwuyansong的专栏-CSDN博客

SELECT a.dev_id,SUBSTRING_INDEX(SUBSTRING_INDEX(a.stage,',',b.help_topic_id+1),',',-1) 
FROM 
my_table a
JOIN
mysql.help_topic b
ON b.help_topic_id < (LENGTH(a.stage) - LENGTH(REPLACE(a.stage,',',''))+1)
ORDER BY a.dev_id;


Original url: Access
Created at: 2020-10-13 10:42:47
Category: default
Tags: none

请先后发表评论
  • 最新评论
  • 总共0条评论