|
背景:对于堆积的条形图,我试图代表一系列医院,显示每个患者诊断的总类别(每个医院)。SQL查询生成了JSON并导出文件。# [' Y4 Y9 L; a) c" r+ B# A
问题:如何改变JSON数组数据结构合并同一医院的多个类别?" q. b4 g# \! ?2 w- [& m: [) Z
我的堆叠条形图JSON数组数据结构(一小部分)如下:
+ b b! F, u4 Q+ V$ i3 g[{ "hospitalName": "hospital1", "category": "Injury & Poisoning", "Females": "0", "Males": "4", "Unknown": "0", "count": "4"},{ "hospitalName": "hospital1", "category": "Symptoms,Signs,& Ill-Defined Conditions", "Females": "1", "Males": "1", "Unknown": "0", "count": "2"},{ "hospitalName": "hospital2", "category": "Mental Disorders", "Females": "0", "Males": "1", "Unknown": "0", "count": "1"}]所需的JSON数组数据结构: P0 l, k$ z0 v# M; x/ v
[{ "hospitalName": "hospital1", "Injury & Poisoning": "4", "Symptoms,Signs,& Ill-Defined Conditions": "2" "Females": "1", 是否可用SQL产生查询?还是可以改用?PLSQL?& I3 P1 K# c8 |' C6 R# k& \. j
; t, z9 f5 Y" C+ c/ y8 I
解决方案: |
|