draw graphs by_temp buckets daily
[zc] / gnuplot / by_temp.sql
diff --git a/gnuplot/by_temp.sql b/gnuplot/by_temp.sql
new file mode 100644 (file)
index 0000000..cd936e6
--- /dev/null
@@ -0,0 +1,13 @@
+select 
+       to_char(min(time), 'YYYY-MM-DD') as time,
+       avg(x_axis_angle) ,
+       avg(y_axis_angle) ,
+       avg(sensor_temperature) ,
+       round((sensor_temperature / 2)) * 2
+from zc
+where pn = 2008050087 -- and time > now() - interval '24 hours'
+group by
+       to_char(time, 'YYYY-MM-DD'),
+       round((sensor_temperature / 2)) * 2
+order by time asc 
+