group_concat逆运算

步骤一:将使用group_concat得到的输出结果导入:
load data infile 'D:/test/output_4_9.txt'
  into table test_111
  fields terminated by '\t'

注意这里文件名路径:只能使用英文,我使用D:\提交\output.txt 就不行;

create table output_4_9_user_id_brand_id
select a.user_id,substring_index(substring_index(a.brand_id,',',b.help_topic_id+1),',',-1) as band_id
from
test_111 a
join
mysql.help_topic b
on b.help_topic_id < (length(a.brand_id) - length(replace(a.brand_id,',',''))+1)
order by a.user_id;
PS: 这里mysql.help_topic是mysql自己的数据库

转载于:https://my.oschina.net/durong/blog/220424

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值