Difference between Where and Having Clause?
WHERE:- Where is used to filter the records in a table. It can be used with SELECT,INSERT and UPDATE clause.Aggregate functions like Sum,Min,Max,Count,Avg cannot be used with where clause if you do so, you will get an SYNTAX error.Where filter the rows before grouping clause.
HAVING:- Having clause is used to filter group records. It can only be used with the SELECT statement. Aggregate functions can be used with Having clause. Having filter the groups after the aggregation are performed.
No comments:
Post a Comment