SQL report help
Can someone please help me add system model to this report I have? it lists system name and the number of missing patches.
Thanks.
Select M.NAME as MACHINE_NAME, M.USER, M.USER_FULLNAME, M.IP, SUM(MS.STATUS='NOTPATCHED') AS NOT_PATCHED
FROM ORG1.PATCHLINK_MACHINE_STATUS MS JOIN ORG1.MACHINE M ON M.ID = MS.MACHINE_ID
JOIN KBSYS.PATCHLINK_PATCH PP ON PP.UID = MS.PATCHUID
JOIN PATCHLINK_PATCH_STATUS PPS ON PPS.PATCHUID = PP.UID
JOIN ORG1.MACHINE_LABEL_JT ML ON (M.ID = ML.MACHINE_ID)
JOIN LABEL L ON (ML.LABEL_ID = L.ID)
where MS.STATUS='NOTPATCHED' AND PPS.STATUS = 0 /* 0=active patches */
and L.NAME LIKE ('%site systems%')
group by MACHINE_NAME
order by MACHINE_NAME
0 Comments
[ + ] Show comments
Answers (1)
Answer Summary:
Please log in to answer
Posted by:
chucksteel
7 years ago
Top Answer
The system model is stored in the CS_MODEL column of the MACHINE table. The MACHINE table has been aliased as M in this query so you would reference the model as CS_MODEL. To add it to the end of the list put ", M.CS_MODEL" after NOT_PATCHED. If you want it someplace else in the list then place it after the column desired making sure to maintain the proper commas.
Comments:
-
Chuck - Thank you worked. - bozadmin 7 years ago