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
Dispenser
.
Toggle Highlighting
SQL
/* Featured articles and their FAC pages */ SELECT article.page_title, FAC.page_title, COUNT(*), COUNT(rev_page), DATE_FORMAT(MIN(rev_timestamp), "%Y-%m-%d") AS First_FAC, DATE_FORMAT(MAX(rev_timestamp), "%Y-%m-%d") AS Last_FAC, SUBSTRING_INDEX(FAC.page_title, "/", -1) AS ArchiveNum, SHA1(REPLACE(article.page_title, "_", " ")), content_title FROM categorylinks JOIN page AS article ON article.page_namespace = 0 AND article.page_id = cl_from JOIN page AS talk ON talk.page_namespace = 1 AND talk.page_title = article.page_title JOIN pagelinks ON pl_from=talk.page_id AND pl_namespace=4 AND pl_title LIKE "%Featured_article_candidates/%" JOIN page AS FAC ON FAC.page_namespace=pl_namespace AND FAC.page_title=pl_title JOIN revision ON rev_page = FAC.page_id JOIN ( SELECT page_title AS content_title, rev_sha1 AS content_sha1 FROM page JOIN revision ON rev_id = page_latest WHERE page_namespace=10 AND page_title LIKE "TFA_title/%" ) AS rev_sha1s ON rev_sha1 = SHA1(REPLACE(article.page_title, "_", " ")) WHERE cl_to IN ("Featured_articles") GROUP BY article.page_id ORDER BY MAX(rev_timestamp) DESC LIMIT 10;
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...