Skip to content

Instantly share code, notes, and snippets.

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 victorpendleton/0974f8e1acb5a6c540643ef0e8e96662 to your computer and use it in GitHub Desktop.
Save victorpendleton/0974f8e1acb5a6c540643ef0e8e96662 to your computer and use it in GitHub Desktop.
SELECT user
, group_concat(time)
, count(*)
FROM information_schema.processlist
WHERE user NOT IN ('some_user') -- Filter out users
AND time > ## -- Filter by time
AND command NOT IN ('sleep') -- Filter by command
GROUP BY 1
ORDER BY 3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment