Can someone tell me the difference between the HAVING and WHERE clause in the below context when i am getting the same results using both the statements
SELECT Table1.DEPT, Sum(Table1.SALARY) AS Comp
FROM Table1
GROUP BY Table1.DEPT
HAVING DEPT="HR"
This goes with WHERE clause.
SELECT Table1.DEPT, Sum(Table1.SALARY) AS Comp
FROM Table1
WHERE DEPT="HR"
GROUP BY Table1.DEPT