TimescaleDB & PostgreSQL
Last updated
select
name,
sum(count) as count,
max(count):: double precision *(1e9) as frequency
from {{TABLE}}
where "carId" = '{{ dataset.carId }}'
group by name
select time / 1e9 as "timestamp", value
from {{TABLE}}
where "carId" = '{{ dataset.carId }}'
{%- if timestamp_start %}
and ({{timestamp_start}} * 1e9)::bigint <= time
{%- endif %}
{%- if timestamp_stop %}
and ({{timestamp_stop}} * 1e9)::bigint >= time
{%- endif %}
and name = '{{ signal.name }}'