WHERE | GROUP BY | |HAVING ORDER BY | | LIMIT GROUP BY cannot go before the WHERE condition.LIMIT cannot go before HAVING.HAVING and ORDER BY are at the same level.