Advertisement
Guest User

Untitled

a guest
Jun 4th, 2019
166
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.   actor_name,
  3.   SUM(
  4.     CASE
  5.       WHEN page_namespace = 0 THEN 1
  6.       ELSE 0
  7.     END
  8.   ) article,
  9.   SUM(
  10.     CASE
  11.       WHEN page_namespace = 10 THEN 1
  12.       ELSE 0
  13.     END
  14.   ) tpl,
  15.   SUM(
  16.     CASE
  17.       WHEN page_namespace = 12 THEN 1
  18.       ELSE 0
  19.     END
  20.   ) helppage,
  21.   SUM(
  22.     CASE
  23.       WHEN page_namespace = 14 THEN 1
  24.       ELSE 0
  25.     END
  26.   ) cat,
  27.   SUM(
  28.     CASE
  29.       WHEN page_namespace = 100 THEN 1
  30.       ELSE 0
  31.     END
  32.   ) portal,
  33.   COUNT(rev_first) tot
  34. FROM revision r
  35. JOIN (
  36.   select
  37.     MIN(rev_id) rev_first,
  38.     rev_page
  39.   FROM revision
  40.   GROUP BY rev_page
  41. ) f
  42.   ON r.rev_id = f.rev_first
  43. JOIN page
  44.   ON page_id = r.rev_page
  45. JOIN actor
  46.   ON rev_actor = actor_id
  47. LEFT JOIN user_groups
  48.   ON actor_user = ug_user
  49.   AND ug_group = "bot"
  50. WHERE
  51.   actor_user <> 0
  52.   AND ug_group IS NULL
  53.   AND page_namespace IN (
  54.     0,
  55.     10,
  56.     12,
  57.     14,
  58.     100
  59.   )
  60. GROUP BY rev_actor
  61. ORDER BY tot desc
  62. LIMIT 300
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement