Fork of
Untitled query #86644
by IKhitron
This query is marked as a draft
This query has been published
by קיפודנחש.
SQL
x
-- change the following values per your needs:
set @pattern = 'סקיבידי'; -- string to look for in edit comment
set @lookback_days = 90; -- days in the past to start searching from. to search "all history" use ridiculously large value - e.g. 40000 which is more than 100 years
set @namespace = 0; -- namespace number. to search all namespaces set next param, @all_namespaces to 1 - in this case, this variable is ignored
-- to search on more than one namespace but less then all, write a more sophisticated query.
set @all_namespaces = 0;
-- do not change the code below, unless you know what you are doing
set @first_date = now() - interval @lookback_days day;
set @first_timestamp = date_format(@first_date, '%Y%m%d%h%i%s');
select concat('[[', replace(p.page_title, '_', ' '), ']]') as 'ערך',
Date(r.rev_timestamp) as 'תאריך',
a.actor_name as 'עורך',
concat('[[Special:diff/', r.rev_id, ']]') as 'הבדל',
if (exists(select 1 from change_tag ct where ct.ct_rev_id = r.rev_id and ct.ct_tag_id in (241, 234)), 'כן', 'לא') as 'שוחזרה',
c.comment_text as 'תקציר'
from revision r
join page p on r.rev_page = p.page_id
join actor a on r.rev_actor = a.actor_id
join comment c on r.rev_comment_id = c.comment_id
where (@all_namespaces = 1 or p.page_namespace = @namespace)
and r.rev_timestamp > @first_timestamp
and c.comment_text REGEXP @pattern > 0
-- and not exists(select 1 from logging where log_page = p.page_id and log_timestamp = r.rev_timestamp)
order by r.rev_timestamp desc
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.