minor fixes, that caused errors during import

This commit is contained in:
alex
2025-02-06 12:49:07 +01:00
parent 99002f10dc
commit fbc528b5e2
2 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ time_differences AS (
event_time::date AS event_date, event_time::date AS event_date,
EXTRACT(EPOCH FROM (event_time - COALESCE(prev_timestamp, event_time))) AS time_diff_in_seconds EXTRACT(EPOCH FROM (event_time - COALESCE(prev_timestamp, event_time))) AS time_diff_in_seconds
FROM start_date FROM start_date
) ),
duration as ( duration as (

View File

@ -17,7 +17,7 @@ WITH device_logs AS (
ORDER BY "device-status-log".event_time) AS prev_value ORDER BY "device-status-log".event_time) AS prev_value
FROM device FROM device
LEFT JOIN "device-status-log" LEFT JOIN "device-status-log"
ON device.uuid::text = "device-status-log".device_id ON device.uuid = "device-status-log".device_id::uuid
LEFT JOIN product LEFT JOIN product
ON product.uuid = device.product_device_uuid ON product.uuid = device.product_device_uuid
WHERE product.cat_name = 'hps' WHERE product.cat_name = 'hps'
@ -56,7 +56,7 @@ SELECT
COUNT(DISTINCT device.uuid) AS count_device COUNT(DISTINCT device.uuid) AS count_device
FROM device FROM device
INNER JOIN "device-status-log" INNER JOIN "device-status-log"
ON device.uuid::text = "device-status-log".device_id::text ON device.uuid = "device-status-log".device_id::uuid
LEFT JOIN product LEFT JOIN product
ON product.uuid = device.product_device_uuid ON product.uuid = device.product_device_uuid
left join presence_detection_summary as pds left join presence_detection_summary as pds