I have 2 queries. 1 shows me the SCCM clients installed in an AD Site [With SCCM clients] and the other shows the clients assigned to the AD Site [total with and without SCCM clients]
I would like to merge them to a single sql report - So I see
AD Site | Clients Assigned to AD Site | SCCM Client installed in that AD Site
Here is query to find SCCM clients installed in that AD Site
========================================
Select AD_Site_Name0 as 'AD Site Name',count(DISTINCT name0) as 'Clients'
FROM v_R_System where Active0 = 1 and Client0 =1 and Obsolete0 != 1 and ad_site_name0 != 'null'
group by AD_Site_Name0
Union all
Select 'TOTAL', sum(A.Clients) from (Select AD_Site_Name0 as 'AD Site Name',count(DISTINCT name0) as 'Clients'
FROM v_R_System where Active0 = 1 and Client0 =1 and Obsolete0 != 1 and ad_site_name0 != 'null'
group by AD_Site_Name0)A
Here is query to find clients assigned in that AD Site
======================================================
Select AD_Site_Name0 as 'AD Site Name',count(DISTINCT name0) as 'Clients'
FROM v_R_System where ad_site_name0 != 'null'
group by AD_Site_Name0
Union all
Select 'TOTAL', sum(A.Clients) from (Select AD_Site_Name0 as 'AD Site Name',count(DISTINCT name0) as 'Clients'
FROM v_R_System where ad_site_name0 != 'null'
group by AD_Site_Name0)A