Skip to content

Instantly share code, notes, and snippets.

@rafaeljesus
Created March 5, 2015 12:04
Show Gist options
  • Select an option

  • Save rafaeljesus/fb86b29d606480043225 to your computer and use it in GitHub Desktop.

Select an option

Save rafaeljesus/fb86b29d606480043225 to your computer and use it in GitHub Desktop.
Search all users with alerts qty more then 100
select u.id, u.login, u.name, p.role
from erm_user u, erm_user_profiles p
where id in (select user_id
from erm_alert
where alert_read = 0
having count(*) > 100
group by user_id)
and u.id = p.user_id
order by 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment