先用数据库拆分出来对应的行
比如oracle里面类似这样
select regexp_substr(a.REGIONS,'[^,]+',1,level) as REGION,rownum as irow
from (select 'AAA,BBB,CCC,DDD' as REGIONS from dual )a
connect by level <= REGEXP_COUNT(a.REGIONS,'[^,]+')

mysql类似这样
select
substring_index(
substring_index(
t.com,
',',
b.help_topic_id + 1
),
',' ,- 1
) AS com_row,
t.myname
from (
select '2021,2019' as com,'张三' as myname
union all
select '2019' as com,'李四' as myname
) t
JOIN mysql.help_topic b ON b.help_topic_id < (
length(t.com) - length(
REPLACE (t.com, ',', '')) + 1)
