Account Group Membership SELECT B.name as group_name, count(A.id) as total from %%AGILE_DB_PREFIX%%account_group A join %%AGILE_DB_PREFIX%%group B on A.group_id=B.id A.site_id = %%DEFAULT_SITE%% and A.active=1 GROUP BY group_name ORDER BY total DESC 0 Group Name group_name true Account Members total true num SELECT B.name as group_name, count(A.id) as total from %%AGILE_DB_PREFIX%%account_group A join %%AGILE_DB_PREFIX%%group B on A.group_id=B.id A.site_id = %%DEFAULT_SITE%% and A.active=1 GROUP BY group_name ORDER BY total DESC