我有这个查询。返回每日最低和最高温度:
select year(DateTimeS),month(DateTimeS),day(DateTimeS),min(Low),max(High) from temperature
where year(DateTimeS) = 2018
group by year(DateTimeS),month(DateTimeS),day(DateTimeS)
我在这个查询中缺少两个字段,LowTime 和 MaxTime。我不知道如何获得最小(低)和最大(高)发生的时间。(DateTimeS 是一个 DateTime 字段,其余为十进制)该表有分分钟的温度数据,如下所示:
+-----------------------+--------+-------+
| "DateTimeS" | "High" | "Low" |
+-----------------------+--------+-------+
| "2018-09-07 23:58:00" | "89" | "87" |
| "2018-09-07 23:57:00" | "88" | "85" |
| "2018-09-07 23:56:00" | "86" | "82" |
| . | | |
| etc... | | |
+-----------------------+--------+-------+
有任何想法吗?