SELECT
sr.entity_id,
sr.strategy_id,
sr.check_detail
FROM
origindb_ss.meishi_qc_scp_copilot__strategy_result sr
WHERE
sr.dt = REPLACE('$$enddate', '-', '')
AND sr.entity_id = 1938826114;
上面这个SQL查询的结果是:
check_detail:[{"ruleId":10554,"taskId":10001,"checkResult":true,"resultJson":{"diagThreshold":"5","currentValue":"6"}},{"ruleId":10555,"taskId":10002,"checkResult":true,"resultJson":{"diagThreshold":"1","currentValue":"1"}},{"ruleId":10556,"taskId":10003,"checkResult":true,"resultJson":{"diagThreshold":"2","currentValue":"2"}},{"ruleId":10557,"taskId":10004,"checkResult":true,"resultJson":{"diagThreshold":"1","currentValue":"1"}},{"ruleId":10558,"taskId":10005,"checkResult":true,"resultJson":{"diagThreshold":"1","currentValue":"3"}}]
可以看到check_detail这个json数据有很多ruleId,我想获得这样的数据
±-----------±------------±-------+
| entity_id | strategy_id | ruleId |
±-----------±------------±-------+
| 1938826114 | 1001 | 10554 |
| 1938826114 | 1001 | 10555 |
| 1938826114 | 1001 | 10556 |
| 1938826114 | 1001 | 10557 |
| 1938826114 | 1001 | 10558 |
±-----------±------------±-------+
哪位大佬能棒棒小弟~
gpt给我的答案是这样的,我试过了不行
在此处键入或粘贴代码