继续潜水

导航

 

数据存储为 

 

 

 实现效果

 

 

 sql:

SELECT
    a.id,
    a.code,
    SUBSTRING_INDEX( SUBSTRING_INDEX( a.monitor_content, ',', b.id + 1 ), ',',- 1 ) AS ids 
FROM
    process_monitoring AS a
    JOIN process_monitor_content AS b ON b.id < ( length( a.monitor_content ) - length( REPLACE ( a.monitor_content, ',', '' ) ) + 1 )
        where a.code ='4203376628674604072';
View Code

process_monitor_content 表为自增序号表

格式ID 自增大于需要分组的字段就可以

 

参考

https://www.cnblogs.com/JMrLi/p/11320273.html

 

posted on 2020-10-13 11:02  继续潜水  阅读(571)  评论(0编辑  收藏  举报