Wednesday 8 April 2015

Difference between where and having clause in sql server



            Where Clause
              Having Clause
1- The WHERE clause cannot contain aggregate functions.
1- The HAVING clause can contain aggregate functions.
2- It can be used without the GROUP BY clause.
2- The HAVING clause cannot be used without the GROUP BY clause.
3- The WHERE clause selects rows before grouping.
3- The HAVING clause selects rows after grouping.

No comments:

Post a Comment