当前位置: 移动技术网 > IT编程>数据库>Mysql > 对账单月字段按逗号分隔形成多条数据

对账单月字段按逗号分隔形成多条数据

2019年07月07日  | 移动技术网IT编程  | 我要评论

'''
select a.id,
substring_index(substring_index(a.bill_ids, ',', b.id), ',', -1) bill_ids,
a.status,
a.card_name
from (select id, bill_ids,status,card_name
from af_repayment
where bill_ids<>' ') a
join af_activity_model b on b.id <= (length(a.bill_ids) - length(replace(a.bill_ids, ',', ''))+1)
order by a.id
'''

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网