0
カスタム時間範囲(間隔なし)でグループ化された値の集計を行い、次に日ごとにグループ化することについて支援が必要です。たとえば:DAYNAMEでグルーピングされたMySQLの時間範囲
select count(values), DAYNAME(date) as Day from data group by Day;
そして、次のように通常の非時間帯をやって:
Monday (00:00-07:00, 07:00-11:00, 11:00-13:00, 13:00-19:00 and 19:00-00:00)
Tuesday (00:00-07:00, 07:00-11:00, 11:00-13:00, 13:00-19:00 and 19:00-00:00)
Wednesday (00:00-07:00 ...
私は次のようになり曜日によってグループに知って
select sum(case when clients between 0 and 30 then 1 end) as '0-30'
,sum(case when clients between 30 and 120 then 1 end) as '30-120'
,sum(case when clients between 120 and 300 then 1 end) as '120-300'
,sum(case when clients between 300 and 900 then 1 end) as '300-900'
,sum(case when clients between 900 and 1800 then 1 end) as '900-1800'
,sum(case when clients between 1800 and 3600 then 1 end) as '1800-3600'
,sum(case when clients between 3600 and 14400 then 1 end) as '3600-14400'
,sum(case when clients >= 14400 then 1 end) as '14400+'
from data;
しかし、それを行う方法時間帯と平日は?
もちろん、例のコードでは、1週間以上のデータにデータを渡すと困惑した結果が返ってきます。 –