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
Cryptic
.
100 mainspace pages chosen sort-of-randomly from those transcluding {{Infobox company}}. Returns a different sent each time it's rerun. page_random is constant for a given page and not terribly uniform. ORDER BY (page_random + @base) MOD 1 is sufficient for a single query, if you only care that it looks randomish; but when repeated, pages listed will always be in the same order, hence mangling it with SHA1(). {{Infobox company}} has roughly 85000 transclusions, which is few enough that the ORDER BY RAND() antipattern works reasonably well, but I just refuse. (Yes, I'm aware mariadb can deal with it; I'm still scarred by bad experiences with sql server.) For [[WP:VPM#Performing a random pages test on business articles]] circa 23 July 2024.
Toggle Highlighting
SQL
SET @base=RAND(); SELECT REPLACE(page_title, '_', ' ') FROM page JOIN templatelinks ON tl_from = page_id JOIN linktarget ON lt_id = tl_target_id WHERE lt_namespace = 10 AND lt_title = 'Infobox_company' AND page_namespace = 0 ORDER BY SHA1(page_random + @base) LIMIT 100;
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...