clickhouse -- clickhouse解析复杂JSON数组

举例

- 查数据

select _id,doctorId,patientId,diagnosisList from patient_disease final where diagnosisList is not null limit 3;

在这里插入图片描述

- 解析数组

SELECT _id,doctorId,patientId,visitParamExtractRaw(diagnosisList,'diagnosisName') FROM patient_disease final where _id in ('655b882da7f855000d5ea34b','655b887ea7f855000d5ea34c','655b889f8d72a3000d4b4a49');

clickhouse -- clickhouse解析复杂JSON数组_第1张图片

- 去掉引号

 SELECT _id,doctorId,patientId,substring(visitParamExtractRaw(diagnosisList,'diagnosisName'),3,-1) FROM patient_disease final where _id in ('655b882da7f855000d5ea34b','655b887ea7f855000d5ea34c','655b889f8d72a3000d4b4a49');

clickhouse -- clickhouse解析复杂JSON数组_第2张图片

你可能感兴趣的:(Clickhouse,clickhouse,json,linux)