我必须将 HANA 表的数据转换为要在其上创建json
模型的数组,所以我有一个如下数组:
[COLOR, TYPE, INFO, DAY, VALUE]
COLOR、TYPE 和 DAY 是主键,所有键的句点都相同:
[BLACK,JEANS,Info01,2020-12-01,25], //start period
[BLACK,JEANS,Info01,2020-12-02,22],
[BLACK,JEANS,Info01,2020-12-03,18],
[BLACK,JEANS,Info01,2020-12-04,33], //end period
[WHITE,SHIRT,Info02,2020-12-01,15], //start period
[WHITE,SHIRT,Info02,2020-12-02,12],
[WHITE,SHIRT,Info02,2020-12-03,58],
[WHITE,SHIRT,Info02,2020-12-04,63], //end period
我想转置它以获得以下数组:
[BLACK,JEANS,Info01,25,22,18,33],
[WHITE,SHIRT,Info02,15,12,58,63],
有没有一种有效的方法来做到这一点?