mysql select sum group by date

前端 未结 6 1568
情歌与酒
情歌与酒 2020-12-02 12:59

Quick question, I have the following table

+-------------+---------------------+
| total       | o_date              |
+-------------+---------------------+
         


        
6条回答
  •  时光取名叫无心
    2020-12-02 13:42

    Get Month And Year wise data from MySQL database:

    SELECT MONTHNAME(o_date), YEAR(o_date), SUM(total) 
    FROM the_table 
    GROUP BY YEAR(date), MONTH(date)
    

提交回复
热议问题