I need to export all customer accounts and their sales statistics (more specifically accounts with ZERO ORDERS). When using the Export Profile Feature with Entity Type "Customers" the field mapping feature gives me no option(s) for anything related to sales data. The only way I know how to identify customer accounts with ZERO purchases is to do it manually within "Manage Customers" which is very laborious to say the least.
you can achieve this with one sql request :
Customers without orders:
select e.email from customer_entity e left join sales_flat_order o on e.entity_id = o.customer_id where o.entity_id is null group by email ;
Customers with total orders
select e.email,count(o.entity_id) as total_orders from customer_entity e inner join sales_flat_order o on e.entity_id = o.customer_id group by email ;