I have a table with accounts and subscription amount and more or less the following query :
SELECT FORMAT_DATE(\"%Y-%m\", DATE(receivedOn)) AS Date,
SUM(amount)
FROM `mytablehere`
GROUP BY Date
ORDER BY Date ASC
The output is fine however some month don't have any subscription so amount is null and the month isn't returned in the final result. Since I'm directly importing the result in a Google Sheet to build a chart from it, not having the full 12 months year is annoying.
Is there a way to generate a "virtual" month for missing month ? Answer to a similar question suggested to create another table with full month and joint the two tables... I'm looking for something simpler...