2 to_char(min(time), 'YYYY-MM-DD HH24') as time,
4 avg(y_axis_angle) - ( ( 20 - avg(sensor_temperature) ) * 0.0001 ),
5 avg(sensor_temperature)
7 where pn = 2008050087 -- and time > now() - interval '24 hours'
8 group by to_char(time, 'YYYY-MM-DD HH24')