hold this
(SELECT to_timestamp("timestamp") as time, value FROM elizabeth.heart_rate_events
WHERE value > 0 and "timestamp" > (extract(epoch from now()) - 300) and value = (SELECT max(value) FROM elizabeth.heart_rate_events
WHERE value > 0 and "timestamp" > (extract(epoch from now()) - 300))
order by timestamp desc
limit 1) union (SELECT to_timestamp("timestamp") as time, value FROM elizabeth.heart_rate_events
WHERE value > 0 and "timestamp" > (extract(epoch from now()) - 300) and value = (SELECT min(value) FROM elizabeth.heart_rate_events
WHERE value > 0 and "timestamp" > (extract(epoch from now()) - 300))
order by timestamp desc
limit 1)
