SQL for a beginner

Select all from table and group

SELECT A.DEPT,
COUNT(A.STAFNO) AS TOTALSTAF
FROM STAFFTABLE A GROUP BY A.DEPT;

Your result should similar like below :-

DEPTTOTALSTAF
Pusat IT 83
Pusat Koko 100
Klinik Universiti 60

-sabalkunan-

Follow PTMUTHM

IT Centre UTHM. All rights Reserved.