Discussion Forum | Board Infinity

Difference between where and having clause. When do we use where function and when do we use having a function

Sql, Function

WHERE clause is used for filtering rows and it applies on each and every row, while HAVING clause is used to filter groups in SQL. One syntax level difference between WHERE and HAVING clause is that the former is used before the GROUP BY clause, while later is used after the GROUP BY clause.