继续潜水

导航

 

ELECT
a.Included_time,
SUBSTRING_INDEX( SUBSTRING_INDEX( a.file_codes, ',', b.help_topic_id + 1 ), ',',- 1 ) AS ids 
FROM
document_flow_master AS a
JOIN mysql.help_topic AS b ON b.help_topic_id < ( LENGTH( a.file_codes ) - LENGTH( REPLACE ( a.file_codes, ',', '' ) ) + 1 )
WHERE
a.deleted = 0 

GROUP BY (SUBSTRING_INDEX( SUBSTRING_INDEX( a.file_codes, ',', b.help_topic_id + 1 ), ',',- 1 ) )
ORDER BY
a.Included_time

posted on 2018-12-19 20:21  继续潜水  阅读(357)  评论(0编辑  收藏  举报