The HAVING clause is used with the GROUP BY clause and filter the groups created by the GROUP BY clause.
Syntax:
SELECT column1, column2,…, columnN FROM tableName WHERE[conditions] GROUP BY column1, column2 …HAVING[conditions];
Example:
Output:
Position of different clauses in a SQL statement:
1. SELECT
2. FROM
3. WHERE
4. GROUP BY
5. HAVING
6. ORDER BY
No comments:
Post a Comment