Question: what is the difference between having and where?
Answer: The main difference between WHERE and HAVING clause comes when used together with GROUP BY clause, In that case WHERE is used to filter rows before grouping and HAVING is used to exclude records after grouping. ... You can even use WHERE clause without HAVING or GROUP BY, as you have seen it many times.