Fork of enwiki: G13 drafts by JJMC89
This query is marked as a draft This query has been published by 0xDeadbeef.

SQL

AخA
 
select  concat('[[Draft:', page_title, ']]') Draft,
        concat('[[', page_title, ']]') Article
from    page p
        left join
        revision r
        on p.page_latest = r.rev_id
where   page_namespace = 118
and     page_is_redirect = 0
and     not exists (select 1 from templatelinks where tl_from = p.page_id and tl_namespace = 10 and tl_title = 'Promising_draft')
and     not exists (select 1 from page where page_namespace = 4 and page_title = concat('Miscellany_for_deletion/Draft:', p.page_title))
and     rev_timestamp < (DATE_FORMAT((NOW() - INTERVAL 6 MONTH),'%Y%m%d%H%i%S'))
union
select  concat('[[User:', page_title, ']]') Draft,
        case
            when substring_index(page_title, '/', -1) in ('', 'sandbox', 'Sandbox') then ''
            else concat('[[', substring_index(page_title, '/', -1), ']]')
        end Article
from    templatelinks tl
        left join
        page p
        on tl.tl_from = p.page_id
        left join
        revision r
        on p.page_latest = r.rev_id
where   tl_from_namespace = 2
and     tl_namespace = 10
and     tl_title = 'AFC_submission'
and     page_is_redirect = 0
and     not exists (select 1 from templatelinks where tl_from = p.page_id and tl_namespace = 10 and tl_title = 'Promising_draft')
and     not exists (select 1 from page where page_namespace = 4 and page_title = concat('Miscellany_for_deletion/User:', p.page_title))
and     rev_timestamp < (DATE_FORMAT((NOW() - INTERVAL 6 MONTH),'%Y%m%d%H%i%S'))
;
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.

Checking query status...