试图从MySQL数据库获得15分钟的间隔

时间:2016-01-07 15:58:36

标签: mysql sql

我有一个sql字符串,我试图在前一天的15分钟内获得一个Count。目前它在12点之后没有显示任何行。任何想法?

SELECT COUNT(*),
       MINUTE(`que_timestamp`) DIV 15 AS `Peorid`,
       HOUR(`que_timestamp`) AS `Hour`
FROM `Que`
WHERE DATE (`que_timestamp`) = (CURDATE() - 1)
GROUP BY HOUR(`que_timestamp`),
         MINUTE(`que_timestamp`) DIV 15
ORDER BY `Hour` ASC

我的que_timestamp是一个MySQL时间戳 enter image description here

0 个答案:

没有答案