dsa122870 2012-05-03 16:24
浏览 42

jQuery flot,MySQL计算每天的行数

I've table for hits that contains of 2 fields

id    time(TIMESTAMP)
1     2012-05-03 08:56:17
2     2012-04-26 03:22:20
3     2012-05-03 08:56:17

How can I count how many rows for each day for example for the past 10 days?

I mean what is the right query for it that produces:

2012-05-03 => 25 hits 2012-05-05 => 55 hits etc

Also, how can i arrange the returned array as jQuery flot array ?

any answers / articles regarding my questions would be great help

Thank you

  • 写回答

2条回答 默认 最新

  • dongxianrang9269 2012-05-03 16:28
    关注

    You want to use a Group By on the date field something like

    select count(*), dateField from tablename 
    group by dateField
    
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器