I'm trying to downsample with interval
in TDengine.
I have a statement:
select _wstart, max(val) max_val, min(val) min_val from d1001 interval(5s);
You can see in the picture, and it is ok.
Now I want to get the timestamp for max/min value, how should I change the sql statement?