Jump to content
RA.BY

SQL group by half hour (or 5, 10, 15, 20, 30 minutes...)


admin

Recommended Posts

I found a lot of ways, but I solved it easier...

 

If we have a table "tab" with a "Dates" field:

Пожалуйста, войдите или зарегистрируйтесь для просмотра скрытого контента.

Similarly, it can be grouped by 15 minutes or any other interval.

 

P.S. If time is in datetime instead of timestamp, then DATE_FORMAT can be used instead FROM_UNIXTIME.

  • Like 1
Link to comment
Share on other sites

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...