表 1 有 800 000 个条目
End_time DAY Exceed C_time stn max start_time
2019-12-26 12:29:34 PROD -41.9 21.1 501 21.1 2019-12-26 12:29:13
2019-12-26 12:30:59 PROD -10.3 52.7 501 52.7 2019-12-26 12:30:07
2019-12-26 12:32:36 PROD -35.8 27.2 503 27.2 2019-12-26 12:32:09
2019-12-26 12:33:54 PROD -53.3 9.7 504 9.7 2019-12-26 12:33:45
2019-12-26 12:35:04 PROD -24.6 38.4 505 38.4 2019-12-26 12:34:26
表 2 有 300 000 个条目
AlarmMessage D_time Priority Station EquipID Active Quality LineName AlarmInTimeStamp
S501LH_B_RR_BT 2 1 501 2200505 True 192 BC1 2019-12-26 12:29:16.5608495
SHT_B_S503_BEAM 21 1 503 2300249 True 192 BC1 2019-12-26 12:32:20.0634165
S503LH_B_RR_T 2 1 503 2200505 True 192 BC1 2019-12-26 12:32:25.6494806
SHT_B_S504_ 21 1 504 2300256 True 192 BC1 2019-12-26 12:33:50.6719676
如果表2“AlarmInTimeStamp”位于表1的“start_time”和“End_time”之间,并且两个表“站”是相同的,那么它们应该合并,以便我最终可以计算出在时间戳和D_time之和期间生成的警报数量
输出是这样的
End_time DAY Exceed C_time stn max start_time AlarmMessage D_time
2019-12-26 12:29:34 PROD -41.9 21.1 501 21.1 2019-12-26 12:29:13 S501LH_B_RR_BT 2
2019-12-26 12:30:59 PROD -10.3 52.7 501 52.7 2019-12-26 12:30:07 - -
2019-12-26 12:32:36 PROD -35.8 27.2 503 27.2 2019-12-26 12:32:09 SHT_B_S503_BEAM 21
S503 LH_B_RR_T 2
2019-12-26 12:33:54 PROD -53.3 9.7 504 9.7 2019-12-26 12:33:45 SHT_B_S504 21
2019-12-26 12:35:04 PROD -24.6 38.4 505 38.4 2019-12-26 12:34:26 - -
30秒到达战场
相关分类