Discussion about SQL queries

Difference between Where and Having clause .

Difference between Where and Having clause .

by Ashrak Shohas -
Number of replies: 0

Difference between Where and Having clause .

Where clause: 

 1.Where clause cannot contain aggregate function. 

 2.Where clause selects rows before grouping.

 3.Where clause can be used with select, insert and update statements.

 4.SELECT Column,AVG(column_name) From Table name WHERE column >value Group BY column _name. 

5.Where clause usually behaves as the pre-filter 

 Having clause: 

 1.Having clause can contain aggregate functions.

 2.Having clause selects rows after grouping. 

 3.Having clause can only be used with the select statements. 4.SELECT Column,AVG(column_name) From Table name WHERE column >value Group BY column _name HAVING column _name>or.

4.Having clause behaves like a post-filter.

5. HAVING clause is executed after groups are created.