Skip to content

Instantly share code, notes, and snippets.

@KentaroAOKI
Created October 4, 2015 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KentaroAOKI/2ff52512ae60e0c4856e to your computer and use it in GitHub Desktop.
Save KentaroAOKI/2ff52512ae60e0c4856e to your computer and use it in GitHub Desktop.
stream analytics query for raspi
SELECT
System.Timestamp as Time,
DeviceId,
CAST(AVG(frompis.Temp) AS float) AS Temp,
CAST(AVG(frompis.Pressure) AS float) AS Pressure,
CAST(AVG(frompis.Hum) AS float) AS Hum,
CAST(AVG(frompis.HiLux) AS float) AS HiLux,
CAST(AVG(frompis.LowLux) AS float) AS LowLux
INTO
powerbi
FROM
raspisensors TIMESTAMP BY Date
GROUP BY
DeviceId,
TumblingWindow(second, 30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment