Skip to content

Instantly share code, notes, and snippets.

@dklawren
Created November 16, 2016 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dklawren/60db6d0bf3598597f8cf58b45fcb8b7e to your computer and use it in GitHub Desktop.
Save dklawren/60db6d0bf3598597f8cf58b45fcb8b7e to your computer and use it in GitHub Desktop.
SELECT DISTINCT
setter.login_name, ft.name, flags.status, grant_group.name
FROM
flag_state_activity AS flags
JOIN
profiles AS setter ON flags.setter_id = setter.userid
JOIN
flagtypes AS ft ON ft.id = flags.type_id
JOIN
groups AS grant_group ON grant_group.id = ft.grant_group_id
WHERE
YEAR(flags.flag_when) = 2016
AND MONTH(flags.flag_when) > 2
AND ft.grant_group_id IS NOT NULL
AND flags.status = '+'
ORDER BY setter.login_name
LIMIT 100000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment