MLDZMNNDA16
    Updated 2023-01-24
    with t1 as (select
    distinct author,
    count(date_trunc('month',CREATEDAT)) as months
    from near.beta.github_activity
    group by 1
    )

    select
    case
    when months=1 then 'a. 1 month'
    when months=2 then 'b. 2 months'
    when months=3 then 'c. 3 months'
    when months=4 then 'd. 4 months'
    when months=5 then 'e. 5 months'
    when months=6 then 'f. 6 months'
    when months>6 then 'g. Over 6 months'
    end as gp,
    count(distinct author) as no_users
    from t1
    group by 1
    Run a query to Download Data