Hello. I am trying to produce a SQL report query that determines the type (model) of system a user has and based off of that information, CASE selects to determine the amount of and type of memory needed to upgrade to 1GB. What I need to do is find a way to tally the information at the end of the report to produce a summary. I was thinking about trying a GROUP BY and SUM on that, but haven't been able to get it to work properly. Any thoughts on how I can approach this?
Thanks in advance for any help,
UCG
------------------------------------------------------------------------------------------
select distinct
v_GS_Computer_system.Name0 AS "PC Name"
, v_GS_Computer_system.UserName0 AS "User last logged on"
, v_GS_Operating_System.caption0 AS "OS"
, v_gs_Operating_system.csdversion0 AS "SP Level"
, v_GS_Computer_system.manufacturer0 AS "Make"
, v_GS_Computer_system.model0 AS "Model"
, v_GS_x86_PC_memory.totalphysicalmemory0 AS "RAM Installed"
, case v_GS_Computer_system.model0
when 'Virtual Machine' then 'Virtual'
when 'VMware Virtual Platform' then 'Virtual'
when 'Evo D310v' then '1'
when 'Evo D510 CMT' then '1'
when 'Evo D510 SFF' then '1'
when 'Evo W4000' then 'Unknown - Varies'
when 'Workstation W6000' then 'Unknown - Varies'
when 'HP dx5150 SFF(PZ585UA)' then '1'
when 'HP d220 MT (DS941A)' then 'Unknown - Varies'
else 'Unknown'
end as 'RAM quantity to achive 1GB'
, case v_GS_Computer_system.model0
when 'Virtual Machine' then 'Virtual'
when 'VMware Virtual Platform' then 'Virtual'
when 'Evo D310v' then '1GB PC2700'
when 'Evo D510 CMT' then '1GB PC2700'
when 'Evo D510 SFF' then '1GB PC2700'
when 'Evo W4000' then 'Need to examine system'
when 'Workstation W6000' then 'Unknown - believe 2 GB'
when 'HP dx5150 SFF(PZ585UA)' then '1GB PC3200'
when 'HP d220 MT (DS941A)' then 'Need to examine system'
else 'Unknown'
end as 'Ram Type'
, v_gs_processor.maxclockspeed0 AS "CPU Speed"
, cast(v_gs_video_controller.CurrentHorizontalResolu tion0 as Varchar) + ' x
' + cast(v_gs_video_controller.CurrentVerticalResoluti on0 as varchar) AS
"Video Resolution"
from
v_gs_computer_system,
v_GS_x86_PC_memory,
v_GS_processor,
v_gs_video_controller,
v_GS_Operating_system
WHERE
v_gs_operating_system.resourceid = v_gs_computer_system.resourceid
and v_gs_computer_system.resourceid = v_gs_computer_system.resourceid
and v_GS_x86_PC_memory.resourceid = v_gs_computer_system.resourceid
and v_GS_processor.resourceid = v_gs_computer_system.resourceid
and v_GS_video_controller.resourceid = v_gs_computer_system.resourceid
and v_GS_Operating_system.caption0 NOT like '%2000 Server%'
and v_GS_Operating_system.caption0 NOT like '%Server 2003%'
and v_GS_video_controller.CurrentHorizontalResolution0 <> ""
and v_GS_x86_PC_memory.totalphysicalmemory0 < '1024768'
Order by
v_gs_computer_system.name0
------------------------------------------------------------------------------------------