V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
liuf
V2EX  ›  MySQL

mysql 统计某一天 24 小时数据 sql 怎么写,如 0, 1, 2, 3...23 统计每个小时的数据

  •  
  •   liuf · 2017-06-05 21:47:54 +08:00 · 3663 次点击
    这是一个创建于 2517 天前的主题,其中的信息可能已经有所发展或是发生改变。

    mysql 统计某一天 24 小时数据 sql 怎么写,如 0,1,2,3...23 统计每个小时的数据。 v 友们给个思路

    2 条回复    2017-06-21 21:34:32 +08:00
    oh
        1
    oh  
       2017-06-05 23:20:51 +08:00
    那要看你数据是怎么存的了,时间戳类型 还是 datetime 类型,还是 hour 有单独存一列
    letitbesqzr
        2
    letitbesqzr  
       2017-06-21 21:34:32 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   910 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 20:55 · PVG 04:55 · LAX 13:55 · JFK 16:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.