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
Gluo88
.
Toggle Highlighting
SQL
/* debugging I was able to complete the above SQL query as seen in https://quarry.wmcloud.org/history/84807/911494/884555. However, when I run the same query again at https://quarry.wmcloud.org/query/84807. I got the error "OperationalError('table resultsets already exists')". How should I fix the error? I guess that resultsets may be a temporary table that was produced in running my previous SQL query. -- Check the current read-only status SHOW GLOBAL VARIABLES LIKE 'read_only'; -- Disable read-only mode SET GLOBAL read_only = OFF; -- Perform your operations DROP TABLE IF EXISTS resultsets; -- Re-enable read-only mode if needed SET GLOBAL read_only = ON; */ -- USE zhwiki_p; -- Check the current read-only status -- SHOW GLOBAL VARIABLES LIKE 'read_only'; -- SHOW TABLES FROM zhwiki_p; -- SHOW TABLES FROM zhwiki_p; /* SELECT a.actor_name, COUNT(*) as count_total FROM page p, revision rf, actor_user a WHERE rf.rev_page = p.page_id AND rf.rev_parent_id = 0 AND a.actor_id = rf.rev_actor AND p.page_namespace = 0 AND p.page_is_redirect = 0 GROUP BY a.actor_name ORDER BY count_total desc ; SELECT a.actor_name, COUNT(*) as count_12m FROM page p, revision rf, actor_user a WHERE rf.rev_timestamp >= DATE_SUB(now(), INTERVAL 12 MONTH) AND rf.rev_page = p.page_id AND rf.rev_parent_id = 0 AND a.actor_id = rf.rev_actor AND p.page_namespace = 0 AND p.page_is_redirect = 0 GROUP BY a.actor_name ORDER BY count_12m desc ; */ -- SHOW COLUMNS FROM resultsets; /* SELECT page_id, page_title FROM page WHERE page_namespace = 0 AND page_is_redirect = 0 LIMIT 300 */ /* SET @VOTE_TIME = 20240616153600; SET @PRIOR_90_VOTE_TIME = 20240318153600; SET @PRIOR_120_VOTE_TIME = 20240217153600; WITH all_revision AS ( SELECT rev_id, rev_actor, rev_page, rev_timestamp FROM revision_userindex UNION SELECT ar_id AS rev_id, ar_actor AS rev_actor, ar_page_id AS rev_page, ar_timestamp AS rev_timestamp FROM archive_userindex ), user_registration AS ( SELECT actor_id, actor_user, actor_name, user_registration FROM actor JOIN user ON actor_user = user_id WHERE user_registration <= @PRIOR_120_VOTE_TIME ) */ /* SELECT user_id, user_name, FROM_UNIXTIME(CAST(CONVERT(user_registration USING utf8) AS UNSIGNED)) AS user_registration, user_editcount WHERE user_registration IS NOT NULL FROM user LIMIT 100; */ /* SELECT actor_id, actor_user, actor_name, FROM_UNIXTIME(CAST(CONVERT(user_registration USING utf8) AS UNSIGNED)) AS user_registration, user_editcount FROM actor JOIN user ON actor_user = user_id -- WHERE user_registration <= @PRIOR_120_VOTE_TIME LIMIT 100; */ /* SET @VOTE_TIME = 20240616153600; SET @PRIOR_90_VOTE_TIME = 20240318153600; SET @PRIOR_120_VOTE_TIME = 20240217153600; WITH all_revision AS (SELECT rev_id, rev_actor, rev_page, rev_timestamp FROM revision_userindex UNION SELECT ar_id AS rev_id, ar_actor AS rev_actor, ar_page_id AS rev_page, ar_timestamp AS rev_timestamp FROM archive_userindex) SELECT actor_user, actor_name, rev_id, rev_timestamp FROM actor JOIN all_revision ON actor_id = all_revision.rev_actor WHERE actor_user IS NOT NULL AND all_revision.rev_timestamp < @PRIOR_120_VOTE_TIME */ /* select user_id, user_name, user_editcount, user_registration from user where user_registration >= 20200501000000 and user_editcount >= 10 order by user_editcount desc; */ select user_id, user_name, user_editcount, user_registration from user where user_registration >= 20200501000000 and user_editcount >= 10 order by user_editcount desc; /* SELECT actor_user, actor_name, COUNT(*) AS edits FROM actor JOIN all_revision ON actor_id = all_revision.rev_actor WHERE actor_user IS NOT NULL AND all_revision.rev_timestamp < @VOTE_TIME AND actor_name = "gluo88" GROUP BY actor_id HAVING edits >= 3000 SELECT actor_id, actor_user, actor_name, user_registration FROM actor JOIN user ON actor_user = user_id WHERE actor_name = "gluo88"; */ /* SHOW COLUMNS FROM user; SHOW COLUMNS FROM actor; SHOW COLUMNS FROM revision_userindex; SHOW COLUMNS FROM archive_userindex; */
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...