Fork of
Average age of WP Croatia articles
by GregorB
This query is marked as a draft
This query has been published
by Ponor.
SQL
AخA
# 20200101: 15245/325.0
# 20210101: 15736/291.0
# 20210110: 15745/285.3
# 20210120: 15756/277.8
# 20210201: 15769/272.7
# 20210210: 15816/274.1
# 20210220: 15872/273.5
# 20210301: 15882/276.1
# 20210310: 15891/278.7
# 20210320: 15938/280.4
# 20210401: 15969/278.1
# 20210410: 15978/276.3
# 20210420: 15983/276.3
# 20210501: 15993/273.3
select count(*), round(avg(age), 1) as avg_age
from (
select pa.page_id,
str_to_date(max(r.rev_timestamp), '%Y%m%d') as ts,
datediff(date '20220810', str_to_date(max(r.rev_timestamp), '%Y%m%d')) - 1 as age
from page pa
inner join revision r on r.rev_page = pa.page_id
where pa.page_namespace = 0 and pa.page_is_redirect = 0 and
pa.page_title in
(
select pt.page_title
from page pt
inner join categorylinks cl on cl.cl_from = pt.page_id
where pt.page_namespace = 1 and cl.cl_to = "WikiProject_Croatia_articles"
) and
r.rev_timestamp < '20220810'
group by pa.page_id
) t
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.