hi all, how can I count row based on its contents?
assumed I have table like this
[table a]
ID_COMPANY | NAME
-----------------------------
A1 | COMPANY A
[table b]
ID_COMPANY | USER | TYPE
--------------------------------------
A1 | USER A | MANAGER
A1 | USER B | DEPT001
A1 | USER C | CUSTOMR
A1 | USER D | DEPT002
A1 | USER E | CUSTOMR
how can i get the result like this?
ID_COMPANY | NAME | TOTAL_MANAGER | TOTAL_STAFF_DEPT | TOTAL_CUST
----------------------------------------------------------------------------
A1 | COMPANY A | 1 | 2 | 1
thx guys