How to query the monthly total amount in the table in MySQL

Don't talk nonsense and go directly to the code

SELECT MONTHNAME( fund_teacher.update_time ) AS x, SUM(fund_teacher.acc_fund_left) AS y 
FROM fund_teacher
GROUP BY x
ORDER BY x DESC

insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/sand_wich/article/details/104912394