Customers by Network/DomainheadingSELECT DISTINCT UCASE(substring_index(A.email,'@', -1)) as domain, count(A.id) as total, sum(B.billed_amt) as sales from %%AGILE_DB_PREFIX%%account A
join %%AGILE_DB_PREFIX%%invoice B on (A.id=B.account_id AND B.billing_status=1 )
A.site_id = %%DEFAULT_SITE%% AND A.email!='' AND A.email IS NOT NULLGROUP BY domain ORDER BY total DESC0DomaindomaintruetruetruefalsefalseTotal Customers: totalTotal Sales: salesdol,2