MySQL: Get start & end timestamp for each day

后端 未结 3 662
无人共我
无人共我 2021-01-25 18:05

Similar to the question at MYSQL: Find Start and End Timestamp of a consecutive count, I have a table with similar data:

StatusTime          | Reading   
2014-01-01 0         


        
3条回答
  •  太阳男子
    2021-01-25 18:38

    Try this code:

      select *
        (select max(StatusTime) from tbl where Reading > 50) above_50,
        (select min(StatusTime) from tbl where Reading < 50) bellow_50;
    

提交回复
热议问题