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 shape_predictor_68_face_landmarks.dat
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制