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
Mastrocom
.
Toggle Highlighting
SQL
USE itwiki_p; CREATE TABLE LinkRossiTemplate( template VARBINARY(255), link VARBINARY(255) CREATE TABLE LinkRossiVoci( id int unsigned, link VARBINARY(255) INSERT INTO LinkRossiTemplate( SELECT page_title, pl_title FROM itwiki_p.page JOIN itwiki_p.pagelinks ON page_id = pl_from WHERE page_namespace=10 AND page_is_redirect=0 AND pl_namespace=0 AND NOT EXISTS ( SELECT * FROM itwiki_p.page AS p WHERE p.page_namespace=0 AND p.page_title = pl_title) INSERT INTO LinkRossiVoci( SELECT page_id, pl_title FROM itwiki_p.page JOIN itwiki_p.pagelinks ON page_id = pl_from WHERE page_namespace=0 AND page_is_redirect=0 AND pl_namespace=0 AND NOT EXISTS ( SELECT * FROM itwiki_p.page AS p WHERE p.page_namespace=0 AND p.page_title = pl_title) ); ALTER TABLE LinkRossiTemplate ADD PRIMARY KEY(template, link); ALTER TABLE LinkRossiTemplate ADD INDEX(template); ALTER TABLE LinkRossiTemplate ADD INDEX(link); ALTER TABLE LinkRossiVoci ADD PRIMARY KEY(id, link); ALTER TABLE LinkRossiVoci ADD INDEX(id); ALTER TABLE LinkRossiVoci ADD INDEX(link); DELETE FROM LinkRossiVoci WHERE EXISTS ( SELECT * FROM itwiki_p.templatelinks JOIN LinkRossiTemplate ON tl_title = template WHERE tl_namespace=10 AND tl_from=LinkRossiVoci.id AND LinkRossiTemplate.link = LinkRossiVoci.link ); DELETE FROM LinkRossiVoci WHERE id IN (SELECT page_id FROM itwiki_p.page JOIN itwiki_p.pagelinks ON page_id = pl_from WHERE pl_namespace = 100 AND pl_title = 'Tennis' AND page_namespace = 0 AND page_is_redirect = 0) SELECT CONCAT('# [[', link, ']] [[Speciale:PuntanoQui/', link, '|(', count(*), ' collegamenti)]]') FROM LinkRossiVoci GROUP BY link ORDER BY count(*) DESC, link LIMIT 500;
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...