I have a query where i would calculate the counts of three Servers
declare @Managed float
declare @Active float
DECLARE @Values varchar(1000)
SET @Values = 'WE,EE,CO'
select @Managed = count(Name0) from v_R_System where Operating_System_Name_and0 like '%Workstation%'
and Obsolete0 = 0 and Client0 = 1 and ResourceID in (select ResourceID from v_AgentDiscoveries Where AgentName In ('Heartbeat Discovery')
and DATEDIFF (day,AgentTime,GetDate())<60)
and User_Domain0 in @Values
select @Active = count(Name0) from v_R_System where Operating_System_Name_and0 like '%Workstation%'
and Obsolete0 = 0 and Client0 = 1 and Active0 = 1
and ResourceID in (select ResourceID from v_AgentDiscoveries Where AgentName In ('Heartbeat Discovery')
and DATEDIFF (day,AgentTime,GetDate())<15)
and User_Domain0 in (@Values)
select 'WorkGroup' as 'WorkGroup', @Managedas 'Managed ',@Active as 'Active'
Here i need output like below
Required o/p
----------------------------------------------
Workgroup Managed Active
'WE' 255 ,400
'EE' 300 ,450
'CO' 155, 600
----------------
So how to use these three values in the where conditon when i use the where clause i have put in condition it will give me the subquery returns more than one value,so how should i use this scenior to accomplish this output