I hope this is not a terribly dumb question. I notice that MySQL will allow me to return to the "Mnth" field in my group and ORDER. This does not apply to every db engine I've worked with. Can anyone argue that this is an OK approach?
SELECT DATE_FORMAT(FROM_UNIXTIME(`swauditlogs`.`dateline`),'%Y-%m') AS Mnth, Count(`swauditlogs`.`ticketid`) AS Count
FROM swauditlogs LEFT JOIN swtickets ON swauditlogs.ticketid = swtickets.ticketid
WHERE swauditlogs.actionmsg Like 'Ticket status changed from:%to: Closed'
GROUP BY Mnth
ORDER BY Mnth DESC
source
share