From ed87c26476fcd615ff036568c345880bb4960528 Mon Sep 17 00:00:00 2001 From: zakhy <=> Date: Fri, 14 Feb 2025 16:31:41 +0700 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=B4=20oracle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/schedulers/tasks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/schedulers/tasks.py b/apps/schedulers/tasks.py index 06de51d..ef85506 100644 --- a/apps/schedulers/tasks.py +++ b/apps/schedulers/tasks.py @@ -563,7 +563,11 @@ def load_asd(): WITH AlarmsWithCount AS ( SELECT *, - COUNT(*) OVER (PARTITION BY OBJID ORDER BY ALARMTIME RANGE BETWEEN INTERVAL '1' MINUTE PRECEDING AND CURRENT ROW) AS alarm_count + COUNT(*) OVER ( + PARTITION BY element + ORDER BY time + RANGE BETWEEN NUMTODSINTERVAL(1, 'MINUTE') PRECEDING AND CURRENT ROW + ) AS alarm_count FROM MFSB.TRUCKALARMS WHERE