Skip to content
Advertisement

MySQL error: HAVING is not valid at this position, expecting EOF, ‘;’

Im having that problem in this specific line:

SELECT city, SUM(credit_limit) AS total_limit 
FROM table 
GROUP BY city 
ORDER BY total_limit 
HAVING SUM(credit_limit) < 110000;

Probably is a stupid error, but im not seeing a syntax problem here.

Advertisement

Answer

SELECT city, SUM(credit_limit) AS total_limit FROM table GROUP BY city ORDER BY total_limit WHERE SUM(credit_limit) < 110000;

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement