Monday, 20 March 2017

Difference between Where & Having in Sql server

  1. WHERE clause can be used with - Select,Insert and Update statements, Where as HAVING Can be used only with select statement
  2. Where filters rows before aggregation(GROUPING),Where as,HAVING filter groups,after aggregations are performed.
  3. Aggregate functions cannot be used in WHERE Clause, unless it is in a subquery contained in HAVING Clause,Whereas,aggregate functions can be used in Having clause.

No comments:

Post a Comment