This query is marked as a draft This query has been published by Mr. Ibrahem.

SQL

AخA
 
SELECT 
    user_name,
    SUM(CASE WHEN log_type = "rights" AND log_params LIKE '%5::newgroups%"bot"%' AND log_params NOT LIKE '%::oldgroups"%"sysop"%5::newgroups%' AND log_params NOT LIKE '%::oldgroups"%"bot"%5::newgroups%' THEN 1 ELSE 0 END) AS "+بوت",
    SUM(CASE WHEN log_type = "rights" AND log_params LIKE '%5::newgroups%"sysop"%' AND log_params NOT LIKE '%::oldgroups"%"sysop"%5::newgroups%' THEN 1 ELSE 0 END) AS "+إداري",
    SUM(CASE WHEN log_type = "rights" AND log_params LIKE '%5::newgroups%"bureaucrat"%' AND log_params NOT LIKE '%::oldgroups"%"bureaucrat"%5::newgroups%' THEN 1 ELSE 0 END) AS "+بيروقراط",
    SUM(CASE WHEN log_type = "rights" AND log_params LIKE '%5::newgroups%"accountcreator"%' AND log_params NOT LIKE '%::oldgroups"%"accountcreator"%5::newgroups%' THEN 1 ELSE 0 END) AS "+منشئ حسابات",
    SUM(CASE WHEN log_type = "rights" AND log_params LIKE '%5::newgroups%"import"%' AND log_params NOT LIKE '%::oldgroups"%"import"%5::newgroups%' THEN 1 ELSE 0 END) AS "+مستورد",
    SUM(CASE WHEN log_type = "rights" AND log_params LIKE '%::oldgroups"%"import"%5::newgroups%' AND log_params NOT LIKE '%5::newgroups%"import"%' THEN 1 ELSE 0 END) AS "-مستورد",
    SUM(CASE WHEN log_type = "rights" AND log_params LIKE '%::oldgroups"%"accountcreator"%5::newgroups%' AND log_params NOT LIKE '%5::newgroups%"accountcreator"%' THEN 1 ELSE 0 END) AS "-منشئ حسابات",
    SUM(CASE WHEN log_type = "rights" AND log_params LIKE '%::oldgroups"%"bot"%5::newgroups%' AND log_params NOT LIKE '%::oldgroups"%"sysop"%5::newgroups%' AND log_params NOT LIKE '%5::newgroups%"bot"%' THEN 1 ELSE 0 END) AS "-بوت",
    
    (SELECT COUNT(*) FROM revision
    INNER JOIN actor ON actor_id = rev_actor
    WHERE actor_user = user_id AND rev_page = 213729 AND rev_minor_edit = 0) AS "وب:طصب"
FROM
    logging, user, actor, user_groups
    where actor_id = log_actor 
    and user_id = ug_user
    AND actor_user = user_id
    AND ug_group = "bureaucrat"
GROUP BY user_name;
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...