每天有会产生很多日志,现在要统计一个月内,每一天,那一时间段登录人数最多,最后按照时间排序
查询条件:月份
with device_online_tmp as
(SELECT to_char(start_date, 'yyyy-mm-') || EXTRACT (day from start_date) as date_,max(online_count) AS online_count,
max(today_online_count) AS today_online_count FROM device_online_count
where to_char(start_date, 'yyyy-mm')='2022-02' GROUP BY date_ )
select to_date(tmp.date_,'yyyy-MM-dd') as date_time ,today_online_count,online_count from device_online_tmp tmp order by date_time asc