我在论坛上找到了我所需要的完全相反的逻辑,所以我不得不问:)
我有这样的字段
|sector|EmployeeNr|Name|Reason|startTime|EndTime|
有了这种样本数据
|Marketing|1|Holydays|Henri|2019-10-03T07:00:00.000Z|2019-10-03T15:00:00.000Z|
|Marketing|1|Holydays|Henri|2019-10-04T07:00:00.000Z|2019-10-04T15:00:00.000Z|
|Marketing|1|Holydays|Henri|2019-10-05T07:00:00.000Z|2019-10-05T15:00:00.000Z|
|Marketing|1|Holydays|Henri|2019-10-06T07:00:00.000Z|2019-10-06T15:00:00.000Z|
|Marketing|1|sickness|Henri|2019-10-08T07:00:00.000Z|2019-10-08T15:00:00.000Z|
|Marketing|1|sickness|Henri|2019-10-09T07:00:00.000Z|2019-10-09T15:00:00.000Z|
|IT-Depart|2|Holydays|Paule|2019-11-08T07:00:00.000Z|2019-11-08T15:00:00.000Z|
|IT-Depart|2|Holydays|Paule|2019-11-09T07:00:00.000Z|2019-11-09T15:00:00.000Z|
|IT-Depart|2|Holydays|Paule|2019-11-10T07:00:00.000Z|2019-11-10T15:00:00.000Z|
|Marketing|1|Holydays|Henri|2019-10-17T07:00:00.000Z|2019-10-17T15:00:00.000Z|
|Marketing|1|Holydays|Henri|2019-10-18T07:00:00.000Z|2019-10-18T15:00:00.000Z|
我想要一个结果,同一原因连续几天缺勤的单行
像这样的东西
|sector|EmployeeNr|Name|Reason|startTime|EndTime|
|Marketing|1|Holydays|Henri|2019-10-03T07:00:00.000Z|2019-10-06T15:00:00.000Z|
|Marketing|1|sickness|Henri|2019-10-08T07:00:00.000Z|2019-10-09T15:00:00.000Z|
|IT-Depart|2|Holydays|Paule|2019-11-08T07:00:00.000Z|2019-11-10T15:00:00.000Z|
|Marketing|1|Holydays|Henri|2019-10-17T07:00:00.000Z|2019-10-18T15:00:00.000Z|
我认为这应该类似于 Date、Reason 和 EmployeeNr 的聚合,但不知道如何处理这个问题。
请问有什么帮助吗?