Oracle SQL查询以从am_session表获取每小时的最大登录数

苏里

如何从am_session表中获取每小时最大登录数,该表具有以下列:userid,create_time(数据类型:timestamp(6))。

附上样本数据。

样本数据

提前致谢

所以我的

您可以执行以下操作-

select 
to_char(create_time, 'YYYY-MM-DD') as create_date, 
extract(hour from create_time) as Hour,
Count(*)
from am_session
group by 
to_char(create_time, 'YYYY-MM-DD'),
extract(hour from create_time)
order by 1, 2 desc;

注意:这将不会为您提供没有登录的小时数。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章