Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
Chaduvari
.
Toggle Highlighting
SQL
use tewiki_p; # 20050101 4874 132 # 20060101 11961 56 # 20070101 25894 64 # 20080101 40636 101 # 20090101 # 20100101 # 20110101 # 20120101 # 20130101 # 20140101 # 20150101 # 20160101 # 20170101 # 20180101 63257 1610 # 20190101 65591 1272 # 20200101 68241 1001 # 20210101 70246 378 select count(*), round(avg(age)) as avg_age from ( select pa.page_id, str_to_date(max(r.rev_timestamp), '%Y%m%d') as ts, datediff(date '20210101', 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 in (0, 102) and pa.page_is_redirect = 0 and r.rev_timestamp < '20170101' 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
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...