到目前为止,我有这段代码,但似乎无法计算 eac 项目上的员工人数。
SELECT p.projno, p.pname, COUNT(e.ename) as "NUM_ASSGD_EMPS", SUM(a.num_hours) as "num_hours"
FROM emp e, assignment a, proj p
WHERE e.empno = a.empno AND p.projno = a.projno
GROUP BY e.ename, p.Projno, p.pname;