(Applicable for builds 14300 & above)
Below query has been modified to add a LEFT JOIN between the additional fields table and the table from which you extracted the softwares:
QUERY:
SELECT SUM(scd.ALLOCATED) AS "Allocated",
SUM(scd.ALLOCATEDTODOWNGRADESW) AS "Allocated To Downgrades",
SUM(scd.AVAILABLE) AS "Available",
MAX(softcomp.COMPLIANCETYPE) AS "Compliance Type",
MAX(softl.DESCRIPTION) AS "Description",
SUM(scd.INSTALLED) AS "Installed", MAX(swmfg.NAME) AS "Manufacturer",
SUM(scd.TOTALSITELICENSES) AS "Purchased",
SUM(scd.CALCOUNT) AS "Purchased CAL",
MAX(softcat.SOFTWARECATEGORY) AS "Software Category",
swadnfld.UDF_CHAR1 AS "TEST ADDITIONAL FIELD",
swadnfld.UDF_CHAR3 AS "TEST ADDITIONAL FIELD 2",
swadnfld.UDF_CHAR5 AS "TEST ADDITIONAL FIELD 3",
swadnfld.UDF_CHAR7 AS "TEST ADDITIONAL FIELD 4",
swadnfld.UDF_CHAR2 AS "TEST ADDITIONAL FIELD 5",
swadnfld.UDF_CHAR4 AS "COST ADDITIONAL FIELD",
swadnfld.UDF_CHAR6 AS "Product code"
FROM SWComplianceBySite scd
LEFT JOIN SWComplianceType softcomp ON scd.SWCOMPLIANCETYPEID=softcomp.SWCOMPLIANCETYPEID
LEFT JOIN SoftwareList softl ON scd.SOFTWAREID=softl.SOFTWAREID
LEFT JOIN SoftwareCategory softcat ON softl.SOFTWARECATEGORYID=softcat.SOFTWARECATEGORYID
LEFT JOIN SoftwareManufacturer swmfg ON softl.SWMANUFACTURERID=swmfg.SWMANUFACTURERID
LEFT JOIN softwareinfo softInfo ON scd.SOFTWAREID=softInfo.SOFTWAREID
LEFT JOIN SoftwareLicense_Fields swadnfld ON softInfo.LICENSEID=swadnfld.LICENSEID GROUP BY scd.SOFTWAREID,swadnfld.UDF_CHAR1,swadnfld.UDF_CHAR3,swadnfld.UDF_CHAR5,swadnfld.UDF_CHAR7,swadnfld.UDF_CHAR2,swadnfld.UDF_CHAR4,swadnfld.UDF_CHAR6
Kindly use the below query to find the colunname and aliasname :
select columnname, aliasname from columnaliases where tablename = 'SoftwareLicense_Fields' order by columnaliasesid;