SQL change of grouped date order

The below SQL (mySQl database) reads data and produces the last 12 months which I use for a graph. This seems fine, but I would like the data in a different order top - oldest month, to bottom latest month, instead of below. Is there a way I can achieve this in one hit with SQL or do I have to resort to additional XOJO manipulation to achieve what I need?

SELECT DATE_FORMAT(Entered, '%b') AS MONTH, SUM(Time_Minutes) AS total FROM reptime WHERE Entered <= NOW() AND Entered >= Date_add(Now(), INTERVAL - 11 MONTH) AND Own_Time = '0' GROUP BY DATE_FORMAT(Entered, '%m-%Y')

Output produced is:

Jan 3479
Feb 4331
Mar 3460
Apr 6214
May 975
Jun 4332
Jul 3000
Aug 6415
Sep 6961
Oct 13401
Nov 6033
Dec 4159

The months before Jan are 2016, those after, 2017 and I would like order (as we are in May 17) below. The figures are correct for each month so I know I have the right numbers, just the wrong order.

Jun 16
Jul 16
Aug 16
Sep 16
Oct 16
Nov 16
Dec 16
Jan 17
Feb 17
Mar 17
Apr 17
May 17

Is there an ‘order by’ I could add that would achieve this?

try “desc” after the groupby dateformat ?

Yes, you can add an ORDER BY to a GROUP BY query (add it after the GROUP BY).

That reverses the list, top Dec → Jan bottom, although you have taught me that GROUP BY can have a DESC clause so thanks for that.

You could also try changing the GROUP BY to DATE_FORMAT(Entered, ‘%Y-%m’).

Thanks all, Jay added the last missing piece which was to change the date format of the ‘date’ in the code, and I also added the year to check. Final solution looks like this;

SELECT DATE_FORMAT(Entered, '%b') AS MONTH, DATE_FORMAT(Entered, '%Y') AS YEAR, SUM(Time_Minutes) AS total FROM reptime_copy WHERE Entered <= NOW() AND Entered >= Date_add(Now(), INTERVAL - 12 MONTH) GROUP BY DATE_FORMAT(Entered, '%Y-%m') DESC

Results in;

Apr 2017 1208
Mar 2017 3721
Feb 2017 5890
Jan 2017 5089
Dec 2016 5294
Nov 2016 7476
Oct 2016 15406
Sep 2016 8111
Aug 2016 7918
Jul 2016 5215
Jun 2016 5589
May 2016 1720