Answer the question
In order to leave comments, you need to log in
Sampling the maximum hourly value?
We have a table like:dt text | un integer
2018-12-28 00:18:35.881|208
2018-12-28 00:18:37.095|208
2018-12-28 00:18:40.095|209
2018-12-28 00:18:43.135|209
2018-12-28 00:18:49.155|209
2018-12-28 00:18:52.159|209
2018-12-28 00:18:56.983|209
select max(un),dt from d5 where dt between datetime('now','localtime','-1 hours') and datetime('now','localtime','-0 hours');
select max(un),dt from d5 where dt between datetime('now','localtime','-2 hours') and datetime('now','localtime','-1 hours');
.........
select max(un),dt from d5 where dt between datetime('now','localtime','-24 hours') and datetime('now','localtime','-23 hours');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question