Quote:
Originally posted by actionant
thanks
i am using Access
|
Actually I'm surprised it even works. Since HAVING applies to the data after it has been grouped, all those columns in your HAVING clause don't even exist at that point, since they weren't selected and used in a GROUP BY. Oracle rejects such a query altogether:
SQL> select count(*) from emp
2 having deptno=10;
having deptno=10
*
ERROR at line 2:
ORA-00979: not a GROUP BY expression
SQL> select count(*) from emp
2 where deptno=10;
COUNT(*)
----------
3