数据存储为
实现效果
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 自增大于需要分组的字段就可以