I am new to SQL, it would be great if you help me. my SQL output is:
| o_date | c_loc | type | output|\
|3-1-22 | center 1 | A | 52 |\
|3-1-22 | center 1 | B | 23 |\
|3-1-22 | center 1 | C | 19 |\
|3-1-22 | center 2 | A | 34 |\
|3-1-22 | center 2 | B | 21 |\
|3-1-22 | center 3 | A | 59 |\
|3-2-22 | center 1 | A | 45 |\
|3-2-22 | center 1 | B | 29 |
As you can see, there are some dates that some locations had no output. I need to fill this lines with 0. There are 11 centers with 3 types. What I need is the table below:
| o_date | c_loc | type | output|\
|3-1-22 | center 1 | A | 52 |\
|3-1-22 | center 1 | B | 23 |\
|3-1-22 | center 1 | C | 19 |\
|3-1-22 | center 2 | A | 34 |\
|3-1-22 | center 2 | B | 21 |\
|3-1-22 | center 2 | C | 0 |\
|3-1-22 | center 3 | A | 59 |\
|3-1-22 | center 3 | B | 0 |\
|3-1-22 | center 3 | C | 0 |\
|3-2-22 | center 1 | A | 45 |\
|3-2-22 | center 1 | B | 29 |\
|3-2-22 | center 1 | C | 0 |
and etc.
As far as I understood I need to use { generate_series()}.
Any help would be great.