1. 首页
  2. 数据库
  3. MySQL
  4. MySQL将一个字段中以逗号分隔的取出来形成新的字段实现

MySQL将一个字段中以逗号分隔的取出来形成新的字段实现

上传者: 2020-12-17 18:59:46上传 PDF文件 60.61KB 热度 22次
1例如:要把如图1的字段拆分图2 select account_id, substring_index(substring_index(a.related_shop_ids,',' ,b.help_topic_id+1),',',-1) shopid from sales_hang_account a join mysql.help_topic b on b.help_topic_id < (length(a.related_shop_ids) - length(replace(a.related_shop_ids,',','')
下载地址
用户评论