Labels

Monday, 21 December 2015

SQL Server - Differences between Where and Having clauses?

The below are the differences between Where and Having Clause.

S.No

Where

Having

1

It applies to individual rows

It applies to a group as a whole

2

It selects rows before grouping

It selects rows after grouping

3

It cannot contain aggregate functions

It can contain aggregate functions

4 It can be used in select, delete ,insert etc. It is used only in select clause

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Thanks for good explanation . It would be great if you can include Syntaxes also .

    ReplyDelete