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

SQL

x
 
use nlwiki_p; 
select A.user_name as Username, A.num_edits as Edits, B.num_thanks as Thanks
from (select user_name, user_editcount as num_edits
    from user) as A
      
join (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-05-01')
         and log_timestamp < timestamp('2018-06-01')
      group by log_title
      limit 5000) as B
      
on A.user_name = B.log_title
order by A.num_edits;
/*
Take every person who has sent (also use for received) a thank in the last month and find how many thanks they sent (or received)
as well as how many edits they have made (ever, as opposed to the edits for the month), 
and order from smallest to largest number of edits
*/
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...