mirror of
https://github.com/SyncrowIOT/data.git
synced 2025-07-16 10:06:17 +00:00
fix
This commit is contained in:
@ -54,8 +54,12 @@ ORDER BY device_id, event_date)
|
|||||||
|
|
||||||
select device_id,
|
select device_id,
|
||||||
event_date,
|
event_date,
|
||||||
CONCAT(FLOOR(motion_seconds / 3600), ':', LPAD(FLOOR((motion_seconds % 3600) / 60)::TEXT, 2, '0')) AS motion_formated_duration,
|
motion_seconds,
|
||||||
CONCAT(FLOOR(presence_seconds / 3600), ':', LPAD(FLOOR((presence_seconds % 3600) / 60)::TEXT, 2, '0')) AS motion_formated_duration,
|
CONCAT(FLOOR(motion_seconds / 3600), ':',LPAD(FLOOR((motion_seconds % 3600) / 60)::TEXT, 2, '0'), ':',LPAD(FLOOR(motion_seconds % 60)::TEXT, 2, '0')) AS motion_formatted_duration,
|
||||||
CONCAT(FLOOR(none_seconds / 3600), ':', LPAD(FLOOR((none_seconds % 3600) / 60)::TEXT, 2, '0')) AS motion_formated_duration
|
presence_seconds,
|
||||||
|
CONCAT(FLOOR(presence_seconds / 3600), ':',LPAD(FLOOR((presence_seconds % 3600) / 60)::TEXT, 2, '0'), ':',LPAD(FLOOR(presence_seconds % 60)::TEXT, 2, '0')) AS presence_formatted_duration,
|
||||||
|
none_seconds,
|
||||||
|
CONCAT(FLOOR(none_seconds / 3600), ':',LPAD(FLOOR((none_seconds % 3600) / 60)::TEXT, 2, '0'), ':',LPAD(FLOOR(none_seconds % 60)::TEXT, 2, '0')) AS none_formatted_duration
|
||||||
from duration
|
from duration
|
||||||
|
order by 1,2
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user