【问题标题】:Active redshift user count for specific time period特定时间段的活动红移用户数
【发布时间】:2017-06-08 09:51:26
【问题描述】:

我需要特定时间段(例如 4 月 20 日至 5 月 25 日)的 Active redshift 用户数。

我知道 PG_user 表,但知道我在寻找什么。 总而言之,我需要一份包含特定时间段(4 月 20 日至 5 月 25 日)的活跃用户数的报告。

非常感谢。

【问题讨论】:

    标签: amazon-redshift


    【解决方案1】:

    您是否需要知道该时间段内有多少用户登录? 逐日获取列表

     select  starttime, process, user_name
     from stl_sessions where starttime>='2017-04-20' starttime <'2017-05-26' 
    

    统计该期间的用户总数:

     select  count(*)
     from stl_sessions where starttime>='2017-04-20' starttime <'2017-05-26'
    

    【讨论】:

    • 您好 MiloBellano,感谢您的更新,但这是 redshift 系统表/视图,仅保存最近 15 天的数据。因此,无法在上述时间段内提取活跃用户数。 select max(starttime),min(starttime) from stl_sessions 结果:max min 2017-06-08 13:00:49 2017-05-24 15:13:50
    猜你喜欢
    • 1970-01-01
    • 2023-03-15
    • 1970-01-01
    • 2014-10-25
    • 1970-01-01
    • 2023-02-08
    • 1970-01-01
    • 2016-07-15
    • 1970-01-01
    相关资源
    最近更新 更多