逆引きマニュアル: MySQL,MariaDB: 時間ごとの集計

投稿日: 更新日:

やりたいこと

MySQL, MariaDBにおいて、時間ごとにグループ化する。

前提条件

概要

手順

select date_format(列名, '%H:00:00') as time, count(*) as count
from テーブル名
group by date_format(列名, '%H');

制限事項

外部サイト

マニュアル