/build/static/layout/Breadcrumb_cap_w.png

How do you omit output that has no data in the field in a report?

I'm having trouble finding the correct SQL code for a particular report that's used to list of computers that have any version of Adobe Acrobat installed grouped by versions. Issue is there are duplicate records being outputted causing skewed reporting. I'd like it to omit any data that has blank fields in the columns, DISPLAY_VERSION and MACHINE_NAME_GROUPED or to prevent duplicates from being displayed to begin with. The following is what i've been working off of and would appreciate any suggestions. Thanks!

SELECT 

    DISPLAY_NAME,

    DISPLAY_VERSION,

    GROUP_CONCAT(DISTINCT MACHINE.NAME

        SEPARATOR '

        ') AS MACHINE_NAME_GROUPED,

    VERSION

FROM

    SOFTWARE

        LEFT JOIN

    MACHINE_SOFTWARE_JT ON (MACHINE_SOFTWARE_JT.SOFTWARE_ID = SOFTWARE.ID)

        LEFT JOIN

    MACHINE ON (MACHINE.ID = MACHINE_SOFTWARE_JT.MACHINE_ID)

WHERE

    (NOT SOFTWARE.IS_PATCH)

        AND (DISPLAY_NAME like 'Adobe Acrobat%')

GROUP BY SOFTWARE.ID

ORDER BY DISPLAY_NAME

 

0 Comments   [ + ] Show comments

Answers (1)

Posted by: dugullett 10 years ago
Red Belt
0

Change the LEFT JOINs to just JOIN.


Comments:
  • Try something like this.

    SELECT DISPLAY_NAME,DISPLAY_VERSION,
    GROUP_CONCAT(DISTINCT M.NAME ORDER BY M.NAME SEPARATOR '\n') AS MACHINE_NAME_GROUPED,
    VERSION
    FROM SOFTWARE S
    JOIN MACHINE_SOFTWARE_JT MSJT ON (MSJT.SOFTWARE_ID = S.ID)
    JOIN MACHINE M ON (M.ID = MSJT.MACHINE_ID)
    WHERE (NOT S.IS_PATCH)
    AND (DISPLAY_NAME like 'Adobe Acrobat %')
    AND (DISPLAY_NAME NOT RLIKE 'UPDATER|CPSID')
    GROUP BY DISPLAY_NAME
    ORDER BY DISPLAY_NAME, DISPLAY_VERSION - dugullett 10 years ago
  • I just tested it, and looks a lot better but still see a duplicates for all versions 8 and 9 related outputs. noticed that items with the version included in the DISPLAY_NAME field had blank DISPLAY_VERSION and vice versa. example: "Adobe Acrobat 9.5.5 - CPSID_83708" would have a blank field for the DISPLAY_VERSION and another line item for the same software would show "Adobe Acrobat 9 Pro - English, Français, Deutsch" for the DISPLAY_NAME and "9.5.5" for the DISPLAY_VERSION". Thoughts and maybe some more great help? - wchoi2104 10 years ago
  • the recent response was for your initial comment. tried the suggested code, and although it removed all DISPLAY_NAME items that ended with -CPSID_XXXX, it also removed some completely off the list. - wchoi2104 10 years ago
    • On mine if there was anything that had the CPSID it also had another entry for Adobe Pro. That's the only reason I did that. To avoid machines being listed twice.

      It really depends on how Kace inventories it. It may be better to add specific versions? I know we have so many machines/versions it's cleaner this way.

      Report for 9:
      AND (DISPLAY_NAME like 'Adobe Acrobat 9%')

      Report for 10:
      AND (DISPLAY_NAME like 'Adobe Acrobat X%')

      Report for 11:
      AND (DISPLAY_NAME like 'Adobe Acrobat XI%') - dugullett 10 years ago
 
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