我有一张这样的桌子
CREATE TABLE news
(
Id INT NOT NULL auto_increment,
Headline VARCHAR (255) NULL,
InDateTime DATETIME NULL
)
如何获取每秒记录数(InDateTime)?
我在用着Mysql
样本记录:
578921, 'headline1', '8/20/2012 12:01:53 PM'
578922, 'headline2', '8/20/2012 12:01:53 PM'
578923, 'headline3', '8/20/2012 12:01:53 PM'
578924, 'headline4', '8/20/2012 12:01:59 PM'
578925, 'headline5', '8/20/2012 12:01:59 PM'
578926, 'headline6', '8/20/2012 12:01:59 PM'
578927, 'headline7', '8/20/2012 12:01:59 PM'
578928, 'headline8', '8/20/2012 12:02:03 PM'
预期输出:
time, count
'8/20/2012 12:01:53 PM', 3
'8/20/2012 12:01:59 PM', 4
'8/20/2012 12:02:03 PM', 1