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
Fæ
.
Undeletes from a given date, with a comment like OTRS in the log, ordered by the length of time since deletion. This may bear no relationship to how recently an email was received at OTRS.
Toggle Highlighting
SQL
USE commonswiki_p; SELECT LEFT(l.log_title, 50) AS Page, LEFT(c.comment_text, 50) AS Comment, LEFT(l.log_timestamp, 8) AS UDate, DATEDIFF(LEFT(l.log_timestamp, 8), LEFT(ll.log_timestamp, 8)) AS Wait FROM (SELECT comment_text, comment_id FROM comment_logging WHERE comment_text LIKE "%OTRS%") AS c JOIN logging_logindex AS l ON l.log_comment_id = c.comment_id JOIN ( SELECT log_timestamp, log_page FROM logging_logindex WHERE log_action="delete" AND log_namespace=6 ) AS ll ON ll.log_page = l.log_page WHERE l.log_timestamp > 20190731000001 AND l.log_timestamp > ll.log_timestamp AND l.log_action = "restore" AND l.log_namespace = 6 ORDER BY Wait 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...