Skip to main content
added 10 characters in body
Source Link
RolandoMySQLDBA
  • 184.3k
  • 33
  • 323
  • 531

I have a datetime columcolumn and I can easily run queries with a group by on my datetime column. However, I would like to run group queries for minute intervals, two minute intervals, 5 minute intervals, hour intervals etc.

  • 1-minute intervals
  • 2-minute intervals
  • 5-minute intervals
  • 1 hour intervals
  • etc.

How do I do this? Thanks.

I have a datetime colum and I can easily run queries with a group by on my datetime column. However, I would like to run group queries for minute intervals, two minute intervals, 5 minute intervals, hour intervals etc.

How do I do this? Thanks.

I have a datetime column and I can easily run queries with a group by on my datetime column. However, I would like to run group queries for

  • 1-minute intervals
  • 2-minute intervals
  • 5-minute intervals
  • 1 hour intervals
  • etc.

How do I do this?

Tweeted twitter.com/#!/StackDBAs/status/204440221004214273
Source Link
dublintech
  • 1.5k
  • 8
  • 21
  • 26

Group by minute and two minute intervals

I have a datetime colum and I can easily run queries with a group by on my datetime column. However, I would like to run group queries for minute intervals, two minute intervals, 5 minute intervals, hour intervals etc.

How do I do this? Thanks.