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
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