diff --git a/Normalize-MediaWiki-link-tables.md b/Normalize-MediaWiki-link-tables.md new file mode 100644 index 00000000..e69de29b diff --git a/tasks/users_this_week/README.md b/tasks/users_this_week/README.md index 707da33c..7b91591e 100644 --- a/tasks/users_this_week/README.md +++ b/tasks/users_this_week/README.md @@ -19,10 +19,11 @@ FROM user_groups INNER JOIN user ON user_id = ug_user WHERE ug_group = "bot") - and actor_name not in (SELECT replace(pl_title,"_"," ") -FROM pagelinks -where pagelinks.pl_from = 7352181 -and pl_namespace = 2) + and actor_name not in (SELECT replace(lt_title, "_", " ") + FROM pagelinks + inner join linktarget ON lt_id = pl_target_id + WHERE pagelinks.pl_from = 7352181 + AND lt_namespace = 2) GROUP BY actor_name having COUNT(*) > 1 ORDER BY score DESC,name diff --git a/tasks/users_this_week/data.py b/tasks/users_this_week/data.py index acd2e36d..68653910 100644 --- a/tasks/users_this_week/data.py +++ b/tasks/users_this_week/data.py @@ -32,10 +32,11 @@ FROM user_groups INNER JOIN user ON user_id = ug_user WHERE ug_group = "bot") - and actor_name not in (SELECT replace(pl_title,"_"," ") -FROM pagelinks -where pagelinks.pl_from = 7352181 -and pl_namespace = 2) + and actor_name not in (SELECT replace(lt_title, "_", " ") + FROM pagelinks + inner join linktarget ON lt_id = pl_target_id + WHERE pagelinks.pl_from = 7352181 + AND lt_namespace = 2) GROUP BY actor_name having COUNT(*) > 1 ORDER BY score DESC,name