mySQL:获取按日期列分隔和排序的多维数组

In a mySQL invoice table there is also a date column like this 02.08.2016 (dd.mm.yy). Now when I query the table and fetch rows sorted by the date column I need finally a result with multidimensional arrays separated by months. The SELECT statement is simply this ;

SELECT * FROM inv ORDER BY date ASC

The fetched result should look like this :

  array [0] { 

           array [0] {
             [num]  => [230]
             [date] => [02.08.2016] // august
             [...]
           }

           array [1] {
             [num]  => [231]
             [date] => [02.08.2016] // august
             [...]
           }
           ...
   }

    array [1] { 

           array [0] {
             [num]  => [350]
             [date] => [10.09.2016] // september
             [...]
           }

           array [1] {
             [num]  => [351]
             [date] => [02.09.2016] // september
             [...]
           }
           ...
    }

    ...

I need this to create at the end for each month a seperate CSV export file. Can I achieve this with a clever mySQL statement or do I need to process the result array afterwards with PHP tools ? If so, what would be the most efficient way to do that ?

Any help and suggestions are welcome

EDIT :

There seems to be a missunderstanding. To make it more clear, I need arrays which lists all available invoices per month. Lets say there are 10 month in the table then there should be 10 arrays from 0..9. Each of these arrays then lists all available invoices per month as arrays (as I figured out below). Lets say array 0 (first month) contains 100 arrays of invoices. Then each invoice array has a set of cells (col) corresponding 1:1 to columns of the table (not summing something). So the answer of this.lau_ must have a different approach. It does not work for me.

You can group by year/month and then apply an aggregate function on your num (for example AVG, SUM, etc.). That should work:

SELECT
    extract(year_month FROM date) as month,
    SUM(num) as sum_num
FROM inv
GROUP BY month ORDER BY month ASC;