User:SQL/SULToMove

From Wikipedia, the free encyclopedia

[edit] Source

CREATE TEMPORARY TABLE `u_sql`.`tempusernames`
        SELECT
                `gu`.`gu_name` AS `gun`
        FROM
                `centralauth_p`.`globaluser` AS `gu`
        WHERE
                `gu`.`gu_name` IN 
                        (SELECT 
                                `u`.`user_name` AS `un`
                        FROM
                                `enwiki_p`.`user` AS `u`
                        WHERE
                                `u`.`user_editcount` = 0
                                AND 
                                        (SELECT
                                                COUNT(*)
                                        FROM
                                                `enwiki_p`.`revision`
                                        WHERE
                                                `rev_user_text` = `u`.`user_name`
                                        ) = 0
                                AND
                                        (SELECT
                                                COUNT(*)
                                        FROM
                                                `enwiki_p`.`archive`
                                        WHERE
                                                `ar_user_text` = `u`.`user_name`
                                        ) = 0
                                AND
                                        `u`.`user_name` NOT IN
                                                (SELECT
                                                        `lu`.`lu_name` AS `lun`
                                                FROM
                                                        `centralauth_p`.`localuser` AS `lu`
                                                WHERE
                                                        `lu`.`lu_wiki` = 'enwiki'
                                                )
                        )
;
 
SELECT
        CONCAT('* {{SUL|',`gun`,'}}')
FROM
        `u_sql`.`tempusernames`
;

SQL Source by User:Cobi, minor revision by User:SQL

[edit] Notes

Prior to MediaWiki v1.9 or so, the software did not track user_editcount. Therefore, some of these may actually have contribs in some limited cases

Fixed!

[edit] List of accounts