none
Duplicate entries in reporting

    Question

  • Hello gentlemen,

    SELECT
    CompName.Name0 as 'Computer Name',
    BIOS.SerialNumber0 as 'SN',
    CompSys.Manufacturer0 as 'Manufacturer',
    CompSys.model0 as 'Model',
    OU.System_OU_Name0 as 'OU'
    
    FROM V_R_System as Sys
    inner JOIN v_GS_PC_BIOS as BIOS on Sys.resourceid = BIOS.resourceid
    inner JOIN v_RA_System_SystemOUName OU on Sys.resourceid = OU.resourceid
    inner JOIN v_GS_COMPUTER_SYSTEM as CompSys on Sys.resourceid = CompSys.resourceid
    inner JOIN v_GS_SYSTEM as CompName on Sys.resourceid = CompName.resourceid
    
    GROUP BY CompName.Name0, SerialNumber0, CompSys.Manufacturer0, CompSys.model0, OU.System_OU_Name0
    ORDER BY OU.System_OU_Name0

    I have my query here combined from other queries found on the web.

    My requirement is just to have machine hostname, serial, maker & model, alongside with where the machine was placed in OU.

    But I found that the results returned will have duplicate machine hostname under different OU:

    WIN7455N	DXX7R1	Dell Inc.	Latitude E6420	DOMAIN.COMPANY.NET/COUNTRY
    WIN7455N	DXX7R1	Dell Inc.	Latitude E6420	DOMAIN.COMPANY.NET/COUNTRY/MY
    WIN7455N	DXX7R1	Dell Inc.	Latitude E6420	DOMAIN.COMPANY.NET/COUNTRY/MY/DEP
    WIN7455N	DXX7R1	Dell Inc.	Latitude E6420	DOMAIN.COMPANY.NET/COUNTRY/MY/DEP/UNIT
    WIN7455N	DXX7R1	Dell Inc.	Latitude E6420	DOMAIN.COMPANY.NET/COUNTRY/MY/DEP/UNIT/GROUP


    Any insight on what could cause this duplicate entries?

    2. From the query, I found on the web that some are using 'inner join' while another is using 'left join'.
    What are the differences between these two?

    Thank you!


    ---Pat

    Tuesday, December 24, 2013 7:52 AM

Answers

All replies