on-internet
← Community

Counting contiguous ranges in a day ( SQL / Google BigQuery )

Stack Overflow ·

So I have something that works , but it's currently a query running for one day / one site. I was wondering if there's a best practice / pattern I should use. As they say , a picture is worth a thousand words, in this example, I have a series of temperature recordings and a given 'safe' range they should fall in. Timing of Alerts ( Line ) vs Temp Range When they are out of range for more than 60 minutes, this triggers an alert , however this isn't recorded in the reporting data, only the temperature ranges. I'm using a quick CTE to cumulatively sum and give a UID to each range concurrent / con

Comments

Sign in or sign up to comment and upvote.

No comments yet.