Hello,
I wanted to clean up my Mautic contact database.
To do this, I want to delete the companies that have no related contacts.
In Mautic it is possible to do this manually company by company.
This is a bit time consuming. So I wrote an SQL query.
The results are : 15139 rows affected. (Query took 0.5347 seconds.)
DELETE FROM companies
WHERE id IN (
SELECT companies.id
FROM companies
EXCEPT
SELECT companies_leads.company_id FROM companies_leads
)
If that helps.
If a developer goes through this and wants to make it a feature (e.g. via a CRON) that would be great.
Pierre