Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dupsykool/f87570c81aea5cfb7b566a2202c37b9c to your computer and use it in GitHub Desktop.
Save dupsykool/f87570c81aea5cfb7b566a2202c37b9c to your computer and use it in GitHub Desktop.
Omnib-queries
select count(*) from (select a.* from (select * from auth_user where created_by_user_id in (select id from auth_user where user_type <> 'ADMIN')) a left join agent on a.id = agent.user_id where a.id in (select id from auth_user where user_type = 'AGENT')) t where id in (select user_id from agent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment