Question: title：Ask the user to enter a string of integers and any number of spaces, and finally sum the numbers：

```
#include<stdio.h>
int main()
{
    int sum=0,ch;
    printf ("Please enter an integer of any length and the number of spaces：");  
    scanf ("%d",&ch); 

    while(ch!='13')
    {
        if(ch!='32') sum=sum+ch;
    }
    printf ("sum=%d\n",sum);

    return 0;
}   

```

When I compile and run according to the following code, I can only input, but cannot calculate the sum of the final sum.

Answer: 
As commented, using one of row generator techniques you'd create a "calendar" table and outer join it with a table that contains data you're displaying.

Something like this (see comments within code):

```
SQL> with yours (amount, datum) as
  2    -- your sample table
  3    (select 100, date '2021-01-01' from dual union all
  4     select 200, date '2021-01-03' from dual union all
  5     select 300, date '2021-01-07' from dual
  6    ),
  7  minimax as
  8    -- MIN and MAX date (so that they could be used in row generator --> CALENDAR CTE (below)
  9    (select min(datum) min_datum,
 10            max(datum) max_datum
 11     from yours
 12    ),
 13  calendar as
 14    -- calendar, from MIN to MAX date in YOUR table
 15    (select min_datum + level - 1 datum
 16     from minimax
 17     connect by level <= max_datum - min_datum + 1
 18    )
 19  -- final query uses outer join
 20  select c.datum,
 21         nvl(y.amount, 0) amount
 22  from calendar c left join yours y on y.datum = c.datum
 23  order by c.datum;

DATUM          AMOUNT
---------- ----------
01.01.2021        100
02.01.2021          0
03.01.2021        200
04.01.2021          0
05.01.2021          0
06.01.2021          0
07.01.2021        300

7 rows selected.

SQL>

```

---

Applied to your current query:

```
WITH
   minimax
   AS
      -- MIN and MAX date (so that they could be used in row generator --> CALENDAR CTE (below)
      (SELECT MIN (created_at) min_datum, MAX (created_at) max_datum
         FROM tickets),
   calendar
   AS
      -- calendar, from MIN to MAX date in YOUR table
      (    SELECT min_datum + LEVEL - 1 datum
             FROM minimax
       CONNECT BY LEVEL <= max_datum - min_datum + 1)
  -- final query uses outer join
  SELECT COUNT (t.id) AS freq, TO_CHAR (TRUNC (c.datum), 'DD-MON') dates
    FROM calendar c LEFT JOIN tickets t ON t.created_at = c.datum
   WHERE TRUNC (t.created_at) > TRUNC (SYSDATE) - 32
GROUP BY TRUNC (c.datum)
ORDER BY dates ASC

```
@Littlefoot answer is perfect. but here is a cheeky way to get the similar table with format match OP output. using a simple cte for this.

```
   WITH cte AS (
     SELECT To_Char(Trunc(SYSDATE - ROWNUM),'DD-MON') dtcol
       FROM DUAL 
    CONNECT BY ROWNUM < 366
    )
    SELECT * FROM cte

```

here is [db<>fiddle](https://dbfiddle.uk/?rdbms=oracle_18&fiddle=7369d7c6fe09b170efa66dd2cc61b7e8)

and then you can simply join this cte to fill up empty date. as the origin output column `date` looks like a string column.  

`connect by` is for oracle only. but I think you can still use recursive cte to get similar result in other DBMS support recursive cte.