SyntaxFix
Write A Post
Hire A Developer
Questions
SELECT MONTHNAME(t.summaryDateTime) as month, YEAR(t.summaryDateTime) as year FROM trading_summary t GROUP BY YEAR(t.summaryDateTime) DESC, MONTH(t.summaryDateTime) DESC
Should use DESC for both YEAR and Month to get correct order.