| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Aggregates on empty groups.
>> SELECT dept, SUM(sal) FROM Employees GROUP BY dept;
.. and departments that are not in emp relation: Finance 0 <<
But if Finance is not the Employees table, how does it get a group? You might build such a thing:
SELECT dept, SUM(sal) FROM Employees GROUP BY dept
UNION
SELECT DISTINCT dept, {NULL | 0.00} FROM OtherDepartments;
or something with an OUTER JOIN, but this is not a simple GROUP BY. Received on Sun Aug 01 2004 - 22:22:04 CDT
![]() |
![]() |