]> www.average.org Git - pulsecounter.git/blob - select.sql
no adjustment for unchanged value
[pulsecounter.git] / select.sql
1 select to_seconds(timestamp) as time, value+adj as value from
2   (select c.timestamp timestamp, c.value value, 
3                 (select sum(value) from coldadj a
4                         where a.timestamp <= c.timestamp
5                 ) adj from coldcnt c order by timestamp
6   ) t;
7 select to_seconds(timestamp) as time, value+adj as value from
8   (select c.timestamp timestamp, c.value value, 
9                 (select sum(value) from hotadj a
10                         where a.timestamp <= c.timestamp
11                 ) adj from hotcnt c order by timestamp
12   ) t;