我已经创建了一个查询,以便在SCCM中获得Win 7和Win 10计数。一切都很好,但是输出并没有达到我想要的结果。
电流输出
DeploymentName CollectionName Available Deadline ReportTime W10 W7
WKS 2019-10 WKS 2019-10 20:23.0 00:00.0 18:00.0 14116 0
WKS 2019-10 WKS 2019-10 20:23.0 00:00.0 18:00.0 27 0
WKS 2019-10 WKS 2019-10 20:23.0 00:00.0 18:00.0 0 2886
WKS 2019-10 WKS 2019-10 20:23.0 00:00.0 18:00.0 0 1预期输出
DeploymentName CollectionName Available Deadline ReportTime W10 W7
WKS 2019-10 WKS 2019-10 20:23.0 00:00.0 18:00.0 14143 2887我创建的查询。
SELECT
CIA.AssignmentName as DeploymentName, CIA.CollectionName as CollectionName, CIA.CreationTime as Available,
CIA.EnforcementDeadline as Deadline, CIA.StartTime as ReportTime, --OPSYS.Caption0 as [Operating System],
--COUNT(*) AS 'Count' ,
sum ( CASE
WHEN OPSYS.Caption0 = 'Microsoft Windows 10 Enterprise' or OPSYS.Caption0 = 'Microsoft Windows 10 Pro' THEN 1 else 0
END ) As 'W10',
sum ( CASE
WHEN OPSYS.Caption0 = 'Microsoft Windows 7 Enterprise' or OPSYS.Caption0 = 'Microsoft Windows 7 Entreprise' THEN 1 else 0
END ) As 'W7'
FROM v_GS_OPERATING_SYSTEM OPSYS
inner join V_R_System sys on OPSYS.ResourceID=sys.ResourceID
Inner join v_FullCollectionMembership FCM on FCM.ResourceID = SYS.ResourceID
--Inner join v_Collection COL on fcm.CollectionID = col.CollectionID
inner join v_CIAssignment CIA on CIA.CollectionID = FCM.CollectionID
WHERE
CIA.AssignmentName = 'WKS 2019-10 '
group by CIA.AssignmentName, CIA.CollectionName, CIA.CreationTime,
CIA.EnforcementDeadline, CIA.StartTime, OPSYS.Caption0我在这里做错什么了?
发布于 2019-11-04 14:53:43
从GROUP BY中移除标题
group by CIA.AssignmentName, CIA.CollectionName, CIA.CreationTime,
CIA.EnforcementDeadline, CIA.StartTimehttps://stackoverflow.com/questions/58695811
复制相似问题