This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |