There is a problem with my query. I have two tables and I want to join them to get results based on the primary key on the first table, but I'm missing 1 piece of data from the first table.
This is my violin
As you can see, I'm missing "xx3" for month 1
I tried changing the left and right connections but still the same result.
So as you can see, I have to set coalesce(sum(b.sd_qty),0) to the total,
if there is no qty
, then 0
is the default value.
You should also cross-join the table to different dates: