SQL
x
use hewiki_p;
select count(*) from page
where page_namespace = 0
and exists
(select * from pagelinks
where page_id = pl_from
# and pl_namespace = 14
and not pl_namespace in (0));
select distinct(pl_namespace) from page inner join pagelinks
on page_id = pl_from
where page_namespace = 0
and not pl_namespace in (0);
select count(*) from page
where page_namespace = 0
and exists
(select * from pagelinks
where page_id = pl_from
# and pl_namespace = 14
and not pl_namespace in (0)
and exists
(select * from page as p3
where p3.page_namespace = pl_namespace
and p3.page_title = pl_title));
select distinct(pl_namespace) from page inner join pagelinks
on page_id = pl_from
where page_namespace = 0
and not pl_namespace in (0)
and exists
(select * from page as p3
where p3.page_namespace = pl_namespace
and p3.page_title = pl_title);
select count(*) from page
where page_namespace = 0
and exists
(select * from pagelinks
where page_id = pl_from
# and pl_namespace = 14
and not pl_namespace in (0)
and not exists
(select * from page as p3
where p3.page_namespace = pl_namespace
and p3.page_title = pl_title));
select distinct(pl_namespace) from page inner join pagelinks
on page_id = pl_from
where page_namespace = 0
and not pl_namespace in (0)
and not exists
(select * from page as p3
where p3.page_namespace = pl_namespace
and p3.page_title = pl_title);
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.