0
I need to select the Plate, the Employee Name and the Number of Dependents of each Employee, but the result of this query is showing the amount of dependents only for the first employee, and I need the quantities for all employees.
Note: If you remove the clause WHERE
, query shows the amount of all dependent table dependent only on the first employee.
Tables: COLLABORATOR AND DEPENDENT
SELECT C.CHAPA, C.NOMECOLABORADOR,
COUNT(D.NOMEDEP) AS QNT_DEP
FROM COLABORADOR C, DEPENDENTE D
WHERE D.CHAPA=C.CHAPA;