mysql - Query for finding how many clerks,manager,salesmen are working in a particular department -
i looking query getting total number of jobs department wise. please me on this. below sample of output.
example:
deptno|anlayst|manager|clerk|salesmen 10 |0 |1 |1 |0 20 |2 |1 |2 |0 30 |0 |1 |1 |4
just sum columns , set group parameter.
for example :
select deptno ,sum(analyst + manager + clerk + salesmen) employeescount tablename group deptno
Comments
Post a Comment