Si entiendo correctamente, debe usar un OUTER JOIN
para obtener los resultados de los meses faltantes, pero también necesita un CROSS JOIN
para obtener el nombre de la empresa correctamente; si no, aparecerá como NULL
:
SELECT months.month,
SUM(job_details.price_each*job_details.quantity) AS sum_monthly_price,
DATE_FORMAT(job.order_date, '%M') AS order_date,
customer.company_name
FROM months CROSS JOIN customer
LEFT JOIN job on job.company_id = customer.company_id
AND months.month = month(job.order_date)
LEFT job_details on job.job_id = job_details.job_id
WHERE months.month > month(date_sub(NOW(), INTERVAL 4 month))
AND months.month <= month(NOW())
AND customer.company_id = 6
GROUP BY months.month
ORDER BY months.month asc