HAVING的作用:
因为where关键字无法与聚集函数一起使用,HAVING可以和聚集函数一起使用
HAVING的语法:
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
HAVING的作用:
因为where关键字无法与聚集函数一起使用,HAVING可以和聚集函数一起使用
HAVING的语法:
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value