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

Ankur Jain
Posted Aug 18, 2014, 4:57 AM EDT3 Answers
Having executed after query
while where executed before query
Mukesh KumarPosted Sep 3, 2017, 12:58 AM EDT
Where--> To filter the records based on condition.
Having-->same as where but here the condition is based on aggregate functions.
Sreekanth ReddyPosted Jul 10, 2015, 10:44 PM EDT
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 whereas WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.
Ankur JainPosted Aug 18, 2014, 4:57 AM EDT

