What is the difference between HAVING and a WHERE in SQL?

WHERE clause is used for filtering rows, and it applies to every row but HAVING term is used to filter groups.

WHERE can be used without the GROUP BY but HAVING clause cannot be used without the GROUP BY.

Suggest An Answer

No suggestions avaliable!

Latest post from SQL Interview Questions

Ask Question