Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有可能通过单个 SQL 查询来获取我的每小时平均数据?
我的表如下所示:
| count | time | | 5 | time() | | 4 | time() |
它每 24 小时重复一次。我想获得一天中每个小时的平均计数。在此先感谢。
像这样的东西可能类似于你想要的
select hour(time) thehour, avg(count) average from yourtable group by hour(time)
我希望这些不是您真正的列名。如果是,您将不得不做一些事情,因为它们也是 sql 关键字。我不使用 mySql,所以我不知道具体是什么。