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.
Any questions about this website feel free to ask us or email This email address is being protected from spambots. You need JavaScript enabled to view it.