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?
DATE_FORMAT(Entered, '%b') AS MONTH,
SUM(Time_Minutes) AS total
Entered <= NOW()
AND Entered >= Date_add(Now(), INTERVAL - 11 MONTH)
AND Own_Time = '0'
Output produced is:
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.
Is there an ‘order by’ I could add that would achieve this?