Improved companies_name_wo_affs SQL query so it works in Eclipse project.
Use subquery before group by to avoid huge tmp files.