Posted - 04/01/2011 : 00:31:17 Hi all
I have a FIXEDASSET table with quite a number of columns in particular 'PC_TYPE', 'DEPARTMENT'
This table has about 50 over records with PC_TYPE column filled with "desktop" and "laptop"
how to i do a query for counting number of laptop and desktop for respective departments
Department | Laptop | Desktop
Mgmt 2 3
IT 3 5
my code:
SELECT (count(PC_TYPE) as" Number of Desktop" FROM FixedAsset where PC_TYPE='desktop ') , select (count(PC_TYPE) as "Number of laptop",PC_USER_DEPARTMENT from fixedasset where PC_Type='laptop')
group by PC_USER_DEPARTMENT;