Skip to content

Instantly share code, notes, and snippets.

@bemasher
Last active October 30, 2016 10:43
Show Gist options
  • Save bemasher/8242b396c6f7c3d032b9373f2a920bc8 to your computer and use it in GitHub Desktop.
Save bemasher/8242b396c6f7c3d032b9373f2a920bc8 to your computer and use it in GitHub Desktop.
CREATE CONTINUOUS QUERY cq_five_years_home ON rtlamr BEGIN
SELECT min(*), mean(*), max(*)
INTO rtlamr.five_years.home
FROM rtlamr.three_days.home
GROUP BY time(1d), "name"
END
// SHOW FIELD KEYS FROM "five_years"."home"
{
"results": [
{
"series": [
{
"name": "home",
"columns": [
"fieldKey",
"fieldType"
],
"values": [
[
"max_battery",
"integer"
],
[
"max_counter",
"integer"
],
[
"max_humidity",
"float"
],
[
"max_signal",
"integer"
],
[
"max_temperature",
"float"
],
[
"mean_battery",
"float"
],
[
"mean_counter",
"float"
],
[
"mean_humidity",
"float"
],
[
"mean_signal",
"float"
],
[
"mean_temperature",
"float"
],
[
"min_battery",
"integer"
],
[
"min_counter",
"integer"
],
[
"min_humidity",
"float"
],
[
"min_signal",
"integer"
],
[
"min_temperature",
"float"
]
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment