1> WHERE Clause Filters rows before grouping. Works with non-aggregate conditions (like simple comparisons on columns). Eg : SELECT employee, bonus FROM emp_bonus WHERE bonus > 5000; 2> HAVING Clause Filters groups after aggregation. Works with aggregate functions (SUM, AVG, MAX, MIN, COUNT). Eg : SELECT employee, SUM(bonus) FROM emp_bonus GROUP BY employee HAVING SUM(bonus) > 5000; 💡 In Short : WHERE = "Which rows should I include in the group?" HAVING = "Which groups should I keep after aggregation?"
Welcome to our blog for SQL and PLSQL. Here you will find about the SQL basic to advance level things along with PLSQL. Also you will get the latest SQL related Interview questions and answers. I hope you will get the things you are looking for here. Happy learning for SQL and PL-SQL.