Hi.
Also functional in SQL Manager Prestashop admin->Advanced Parameters->Database->SQL Manager
E.g. for id category = 4:
SELECT a.id_customer, a.firstname, a.lastname, a.email FROM ps_customer a LEFT JOIN ps_orders o ON a.id_customer = o.id_customer LEFT JOIN ps_order_detail b ON o.id_order = b.id_order LEFT JOIN ps_category_product c ON b.product_id = c.id_product WHERE c.id_category = 4 GROUP BY a.id_customer