April 17, 2016

Group by and Having Clause

HAVING CLAUSE and a WHERE CLAUSE?


The HAVING clause is a filter that acts similar to a WHERE clause, but the filter acts on groups of rows rather than on individual rows.


In other words, the HAVING clause is used to qualify the results after the GROUP BY has been applied.
The WHERE clause, in contrast, is used to qualify the rows that are returned before the data is 

aggregated or grouped.
HAVING qualifies the aggregated data after the data has been grouped or aggregated.


No comments:

Post a Comment