What is the difference between a HAVING CLAUSE and a WHERE CLAUSE? | SansSQL

Thursday, June 12, 2008

What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?

Specifies a search condition for a group or an aggregate. HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is basically used only with the GROUP BY function in a query. WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.

1 comment:

jatin nahar said...

this is very good explanation, for easy and better explanation you can visit
this link
http://dotnetpeoples.blogspot.com/2011/04/having-clause-vs-where-clause.html

Post a Comment