Jump to content
RA.BY

Leaderboard

Popular Content

Showing content with the highest reputation on 04/11/2023 in all areas

  1. I found a lot of ways, but I solved it easier... If we have a table "tab" with a "Dates" field: SELECT case when FROM_UNIXTIME(Dates, '%i')<=29 then FROM_UNIXTIME(Dates, '%Y/%m/%d %H:00:00') when FROM_UNIXTIME(Dates, '%i')>=30 then FROM_UNIXTIME(Dates, '%Y/%m/%d %H:30:00') end as datka, COUNT(*) FROM tab group by datka 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.
    0 points
This leaderboard is set to Minsk/GMT+03:00
×
×
  • Create New...