Friday, August 2, 2019

Difference between where clause and having clause?

WHERE clause is used for filtering rows and it applies on each and every row, while HAVING clause is used to filter groups in SQL.

One syntax level difference between WHERE and HAVING clause is that, former is used before GROUP BY clause, while later is used after GROUP BY clause


SELECT * FROM EMP WHERE DEPTNO=10;

SELECT COUNT(*),DEPTNO FROM EMP GROUP BY DEPTNO HAVING COUNT(*)>4

No comments:

Post a Comment

AME (Approval Management Engine)

AME (Approval Management Engine) : AME Stands for Oracle Approval Management Engine. AME is a self service web application that enables...