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
Huji
.
Toggle Highlighting
SQL
SELECT log_id, log_id, actor_name, CONCAT('{{ns:' , log_namespace, '}}:', log_title) AS link, comment_text, STR_TO_DATE(LEFT(log_timestamp, 8), '%Y%m%d'), 'محافظت طولانی' AS issue, DATEDIFF( DATE( concat( SUBSTRING(log_params, locate('s:6:"expiry";', log_params) + 19, 4), SUBSTRING(log_params, locate('s:6:"expiry";', log_params) + 23, 2), SUBSTRING(log_params, locate('s:6:"expiry";', log_params) + 25, 2) ) ), DATE(SUBSTRING(log_timestamp, 1, 8)) ) AS duration_days, CASE WHEN log_params LIKE '%s:6:"expiry";s:8:"infinity"%' THEN 1 ELSE 0 END AS duration_infinity FROM ( SELECT log_id, log_actor, actor_name, log_title, log_namespace, log_timestamp, log_comment_id FROM logging_userindex JOIN actor ON log_actor = actor_id JOIN user_groups ON actor_user = ug_user WHERE log_type = 'protect' AND log_action = 'protect' AND ug_group = 'eliminator' AND log_timestamp >= DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 30 DAY), '%Y%m%d000000') ) AS block_logs JOIN comment ON log_comment_id = comment_id WHERE duration_days > 14 OR duration_infinity = 1 ORDER BY log_id DESC
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...