SQL
AخA
USE commonswiki_p;
SELECT LEFT(l.log_title, 50) AS Page,
c.comment_text AS Comment,
LEFT(l.log_timestamp, 8) AS UDate,
DATEDIFF(LEFT(MAX(ll.log_timestamp), 8), LEFT(l.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 > 20190916000001
AND l.log_timestamp > ll.log_timestamp
AND l.log_action = "restore"
AND l.log_namespace = 6;
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.