/build/static/layout/Breadcrumb_cap_w.png

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:
Posted by: chucksteel 7 years ago
Red Belt
0

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

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ