MySQL GROUP BY DateTime +/- 3 seconds

后端 未结 5 1213
再見小時候
再見小時候 2020-12-03 05:34

Suppose I have a table with 3 columns:

  • id (PK, int)
  • timestamp (datetime)
  • title (text)

I have the following records:

         


        
5条回答
  •  渐次进展
    2020-12-03 05:58

    Simple query:

    SELECT * FROM time_history GROUP BY ROUND(UNIX_TIMESTAMP(time_stamp)/3);
    

提交回复
热议问题