Fork of
FA WP pages in a moved category
by Huji
This query is marked as a draft
This query has been published
by Huji.
SQL
AخA
use fawiki_p;
select cl_to, count(*) CNT from
(
select
case when page_namespace = 0 then page_title
else concat('{{ns:', page_namespace, '}}:', page_title)
end as page_title,
cl_to from
(
select cl1.cl_from, cl1.cl_to
from categorylinks cl1
join page
on cl1.cl_to = page_title
and page_namespace = 14
join categorylinks cl2
on page_id = cl2.cl_from
and cl2.cl_to = 'رده•های_منتقل•شده'
limit 5000
) redir
join page
on cl_from = page_id
) cats
group by cl_to
order by 2 desc
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.