2020
10-30
10-30
MySQL将一个字段中以逗号分隔的取出来形成新的字段实现
1例如:要把如图1的字段拆分图2selectaccount_id,substring_index(substring_index(a.related_shop_ids,',',b.help_topic_id+1),',',-1)shopidfromsales_hang_accountajoinmysql.help_topicbonb.help_topic_id<(length(a.related_shop_ids)-length(replace(a.related_shop_ids,',',''))+1)orderbya.account_id2:然后和shops表进行连接查询取出我们需要的字段,我这里需要取出nameselect...
继续阅读 >