mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 15:17:41 +00:00
fix
This commit is contained in:
@ -4,7 +4,8 @@ WITH presence_logs AS (
|
||||
l.device_id,
|
||||
l.event_time,
|
||||
l.value,
|
||||
LAG(l.event_time) OVER (PARTITION BY l.device_id ORDER BY l.event_time) AS prev_time
|
||||
LAG(l.event_time) OVER (PARTITION BY l.device_id ORDER BY l.event_time) AS prev_time,
|
||||
LAG(l.value) OVER (PARTITION BY l.device_id ORDER BY l.event_time) AS prev_value
|
||||
FROM device d
|
||||
JOIN "device-status-log" l ON d.uuid = l.device_id
|
||||
JOIN product p ON p.uuid = d.product_device_uuid
|
||||
|
Reference in New Issue
Block a user