For example suppose I have
SELECT sum(...) as total
Can I do something like
WHERE total > 10
When I try that actual syntax I get an error unknown column 'total' in 'where clause' using MySQL
对于涉及聚集的条件,请使用HAVING
而不是WHERE
:
SELECT SUM(somecolumn) AS total FROM sometable HAVING total > 10;
尝试HAVING
HAVING total > 10
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.