i'm working on a small PHP and Mysql project and i want o show my sales of the two last years for example 2018 and 2019. how can i show all the months of the year This is my sql query :
SELECT YEAR(b.creation_date) AS annee
, MONTH(b.creation_date) AS mois
, SUM(price * quantity) AS total_ca
FROM invoicesitems a
JOIN invoices b
WHERE a.invoice_id = b.invoice_id
AND b.client = 6
GROUP BY YEAR(b.creation_date), MONTH(b.creation_date)
ORDER BY YEAR(b.creation_date), MONTH(b.creation_date)
And this is my result in English :
--------------------------
year | month | total_ca
--------------------------
2018 | 6 | 1548.00
--------------------------
2019 | 6 | 143.000
as you can see i have only month number 6 (june) how can i show all the months from 1 to 12.