Fork of KSA new articles by months test 14 by FShbib
This query is marked as a draft This query has been published by FShbib.

SQL

x
 
use arwiki_p;
SELECT left(t4.rev_timestamp,4) as Menesis, count(left(t4.rev_timestamp,4)) as Raksti
FROM revision AS t4
 JOIN page article ON 
    article.page_id = rev_page AND
    article.page_namespace = 0
INNER JOIN page talk ON 
    talk.page_title = article.page_title AND
    talk.page_namespace = 1
INNER JOIN categorylinks ON 
    cl_from = talk.page_id
    AND cl_to = "مقالات_مشروع_ويكي_السعودية"
WHERE t4.rev_id IN (
Select min(t45.rev_id)
From revision t45
inner join page p on t45.rev_page=p.page_id
where p.page_namespace=0 and p.page_is_redirect=0
  #and t45.rev_page in (select cl_from from categorylinks where cl_from = rev_page and cl_to = "بوابة_السعودية/مقالات_متعلقة") 
group by t45.rev_page
having min(t45.rev_id)
order by min(t45.rev_id) desc
)
GROUP BY left(t4.rev_timestamp,4)
#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.
All SQL code is licensed under CC0 License.

Checking query status...