This question has already been answered:
There is a table date | sum The date field contains the date of the DATE format (2018-01-01) The sum field contains a number (for example, 5000)
The task: to make a request for data sampling in such a way that at the output to get an array with the sum of all the sum values for one month.
Example:
- 2018-01-01 | 5000
- 2018-01-02 | 3000
- 2018-02-01 | 1000
The output should be:
- January - 8000
- February - 1000
I read a bunch of manas, forums, articles, but did not find a solution. Tell me how to do better?