This may help you. The inline view makes cartesian product job*department thus can be slow for large tables.
AlesCode:select count(e.emp_no), v.dept_no, v.job_no from employee e, ( select d.dept_no, j.job_no from job j, department d ) v where e.job_no (+) = v.job_no and e.dept_no (+) = v.dept_no group by v.job_no, v.dept_no order by 3,2




Reply With Quote