没有看明白你的意思到底要做什么
select
tmp.com,
GROUP_CONCAT(tmp.id) as id_str
from (
select
t2.id,
t1.com_row,
t1.com
from data_standard t2 left join
(
select
t.com,
substring_index(
substring_index(
t.com,
',',
b.help_topic_id + 1
),
',' ,- 1
) AS com_row
from (
select related_id as com from data_compound
) t
JOIN mysql.help_topic b ON b.help_topic_id < (
length(t.com) - length(
REPLACE (t.com, ',', '')) + 1)
) t1 on t2.id=t1.com_row
) tmp group by tmp.com