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
Mike.Khoroshun
.
Toggle Highlighting
SQL
UPDATE page AS p SET p.page_content = CASE WHEN ( SELECT COUNT(DISTINCT r.rev_user) FROM revision r JOIN actor a ON r.rev_actor = a.actor_id JOIN user u ON a.actor_user = u.user_id LEFT JOIN user_groups ug ON u.user_id = ug.ug_user WHERE r.rev_page = p.page_id AND r.rev_parent_id = 0 AND NOT EXISTS ( SELECT 1 FROM user_groups ug2 WHERE ug2.ug_user = u.user_id AND ug2.ug_group = 'patroller' ) ) >= 10 AND ( SELECT SUM(r.rev_len) FROM revision r WHERE r.rev_page = p.page_id ) >= 10000 THEN REPLACE(p.page_content, '}}', '|risk_rate=5}}') WHEN ( SELECT COUNT(DISTINCT r.rev_user) FROM revision r JOIN actor a ON r.rev_actor = a.actor_id JOIN user u ON a.actor_user = u.user_id LEFT JOIN user_groups ug ON u.user_id = ug.ug_user WHERE r.rev_page = p.page_id AND r.rev_parent_id = 0 AND NOT EXISTS ( SELECT 1 FROM user_groups ug2 WHERE ug2.ug_user = u.user_id AND ug2.ug_group = 'patroller' ) ) >= 6 AND ( SELECT SUM(r.rev_len) FROM revision r WHERE r.rev_page = p.page_id ) >= 6000 THEN REPLACE(p.page_content, '}}', '|risk_rate=4}}') WHEN ( SELECT COUNT(DISTINCT r.rev_user) FROM revision r JOIN actor a ON r.rev_actor = a.actor_id JOIN user u ON a.actor_user = u.user_id LEFT JOIN user_groups ug ON u.user_id = ug.ug_user WHERE r.rev_page = p.page_id AND r.rev_parent_id = 0 AND NOT EXISTS ( SELECT 1 FROM user_groups ug2 WHERE ug2.ug_user = u.user_id AND ug2.ug_group = 'patroller' ) ) >= 3 AND ( SELECT SUM(r.rev_len) FROM revision r WHERE r.rev_page = p.page_id ) >= 3000 THEN REPLACE(p.page_content, '}}', '|risk_rate=3}}') WHEN ( SELECT COUNT(DISTINCT r.rev_user) FROM revision r JOIN actor a ON r.rev_actor = a.actor_id JOIN user u ON a.actor_user = u.user_id LEFT JOIN user_groups ug ON u.user_id = ug.ug_user WHERE r.rev_page = p.page_id AND r.rev_parent_id = 0 AND NOT EXISTS ( SELECT 1 FROM user_groups ug2 WHERE ug2.ug_user = u.user_id AND ug2.ug_group = 'patroller' ) ) >= 1 AND ( SELECT SUM(r.rev_len) FROM revision r WHERE r.rev_page = p.page_id ) >= 500 THEN REPLACE(p.page_content, '}}', '|risk_rate=2}}') ELSE REPLACE(p.page_content, '}}', '|risk_rate=1}}') END WHERE p.page_namespace = 0 AND p.page_id IN ( SELECT r.rev_page FROM revision r JOIN actor a ON r.rev_actor = a.actor_id JOIN user u ON a.actor_user = u.user_id WHERE u.user_name = "Haida" AND r.rev_parent_id = 0 );
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...