SELECT systeminfo.workstationname "Workstation",
Max(aaauser.first_name) "User",
( softwarelist.softwarename ) "Software_Name",
Max(softwaretype.softwaretype) "Software_Type",
Max(softwarecategory.softwarecategory) "Software_Category",
Max(wmiswusageinfo.softwareusage) "Software_Usage",
Max(softwareinfo.fileversion) "File Version",
Max(swinstallationkeyinfo.productid) "Software_ID",
Max(swinstallationkeyinfo.productkey) "Software_Key",
Max(aaov.NAME) "Site",
Max(resLocation.location) "Location" FROM softwareinfo
LEFT JOIN softwarelist
ON softwareinfo.softwareid = softwarelist.softwareid
LEFT JOIN softwaretype
ON softwarelist.softwaretypeid = softwaretype.softwaretypeid
LEFT JOIN wmiswusageinfo
ON softwareinfo.softwareinfoid = wmiswusageinfo.softwareinfoid
LEFT JOIN swinstallationkeyinfo
ON softwareinfo.softwareinfoid =
swinstallationkeyinfo.softwareinfoid
LEFT JOIN softwarecategory
ON softwarelist.softwarecategoryid =
softwarecategory.softwarecategoryid
LEFT JOIN systeminfo
ON softwareinfo.workstationid = systeminfo.workstationid
LEFT JOIN resources resource
ON systeminfo.workstationid = resource.resourceid
LEFT JOIN resourceowner rOwner
ON resource.resourceid = rOwner.resourceid
LEFT JOIN resourceassociation rToAsset
ON rOwner.resourceownerid = rToAsset.resourceownerid
LEFT JOIN sduser sdUser
ON rOwner.userid = sduser.userid
LEFT JOIN aaauser aaaUser
ON sduser.userid = aaauser.user_id
LEFT JOIN resourcelocation resLocation
ON resource.resourceid = resLocation.resourceid
LEFT JOIN sitedefinition siteDef
ON resLocation.siteid = siteDef.siteid
LEFT JOIN sdorganization aaov
ON siteDef.siteid = aaov.org_id
WHERE ( softwarelist.softwaretypeid = 2 )
GROUP BY systeminfo.workstationname,
softwarelist.softwarename
ORDER BY 1