HosseinUntitled Query
Updated 2023-01-26Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
with
t2 as (
select
repo as repository,
min(date_trunc('month', createdat)) as min_date
from near.beta.github_activity
group by 1
)
select
date_trunc('month', createdat::date) as day,
count(distinct t2.repository) as new_repositories_count,
count(distinct a.repo) as active_repositories_count,
sum(new_repositories_count) over(order by day) as cumulative_new_repositories_count,
sum(active_repositories_count) over(order by day) as cumulative_active_repositories_count
from near.beta.github_activity a
left join t2
on a.createdat::date = t2.min_date::date
group by 1
Run a query to Download Data