Skip to content

Instantly share code, notes, and snippets.

@mutolisp
Created August 9, 2020 09:55
Show Gist options
  • Save mutolisp/00470c59bf6eefc232f9b7cb8d2031ac to your computer and use it in GitHub Desktop.
Save mutolisp/00470c59bf6eefc232f9b7cb8d2031ac to your computer and use it in GitHub Desktop.
timescaleDB get time period
SELECT
time_bucket('1 day', timestamp) AS period,
summit,
direction,
avg(temperature),
max(temperature),
min(temperature)
FROM
temperature_hyper
WHERE
summit='DSH'
group by period,summit,direction
order by summit,period
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment