Sql having

This article is tagged with: Sql having and mysql

SQL HAVING

SELECT COUNT(CustomerID), Country
FROM Customers
GROUP BY Country
HAVING COUNT(CustomerID) > 5;

sql count having

SELECT COUNT( * )
FROM agents
HAVING COUNT(*)>1; --count is greater than 1

mysql HAVING

SELECT colonne1, SUM(colonne2)
FROM nom_table
GROUP BY colonne1
HAVING fonction(colonne2) operateur valeur

This article is tagged with: Sql having and mysql