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

SQL

x
 
use kowiki_p; 
select A.rev_user as ID, A.num_edits as Edits, coalesce(B.num_thanks, 0) as Thanks, C.user_name, C.user_id, A.rev_user_text
      
from (select log_title, count(log_title) as num_thanks
      from logging_userindex
      where
         log_action = 'thank' and log_type='thanks'
         and log_timestamp < timestamp('2018-06-01')
         and log_timestamp >= timestamp('2018-05-01')
      group by log_title) as B
 
left join (select user_id, user_name
  from user) as C
on B.log_title = C.user_name
      
     
join (select rev_user, rev_user_text, count(rev_user) as num_edits
    from revision
    where
        rev_timestamp < timestamp('2018-06-01') 
        and rev_timestamp >= timestamp('2018-05-01') 
        and rev_user != 0 
    group by rev_user
    order by count(rev_user)) as A
      
on A.rev_user = C.user_id;
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...