MYSQL解析json

如图所示:想转成三行数据,两个字段,fassgrp, fvalue ,image.pngimage.png

蕉太狼 发布于 2022-5-16 17:00
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
0
CD20160914Lv8专家互助
发布于2022-5-16 17:12

select 

t1.com,

left(t1.com,instr(t1.com,':')-1) as e,

mid(t1.com,instr(t1.com,':')+1,50) as e2

 from (

select 

substring_index(

substring_index(

t.com,

',',

b.help_topic_id + 1

),

',' ,- 1

) AS com

 from (

select 'f005:13466664685,f0006:3667477,f0008:3555' as com

) t 

JOIN mysql.help_topic b ON b.help_topic_id < (

length(t.com) - length(

REPLACE (t.com, ',', '')) + 1)

) t1

image.png

  • 2关注人数
  • 287浏览人数
  • 最后回答于:2022-5-16 17:12
    请选择关闭问题的原因
    确定 取消
    返回顶部