SELECT resource.resourcename "Computer Name",
Max(net.ipaddress) IP,
Max(softwarelist.softwarename) "Software_Name",
Max(resource.acquisitiondate) "Acquisition Date",
Max(resource.expirydate) "Expiry Date",
Max(swinstallationkeyinfo.productid) "Software_ID",
Max(swinstallationkeyinfo.productkey) "Software_Key" FROM softwareinfo
LEFT JOIN softwarelist
ON softwareinfo.softwareid = softwarelist.softwareid
LEFT JOIN swinstallationkeyinfo
ON softwareinfo.softwareinfoid =
swinstallationkeyinfo.softwareinfoid
LEFT JOIN componentdefinitionsoftware
ON softwarelist.softwareid =
componentdefinitionsoftware.softwareid
LEFT JOIN resources resource
ON softwareinfo .workstationid= Resource.resourceid
LEFT JOIN softwarelicenses
ON Resource.resourceid = softwarelicenses.resourceid
LEFT JOIN NetworkInfo net on net.workstationid=resource .resourceid
where softwarelist.softwarename like '%windows%' and softwarelist.softwaretypeid=2GROUP BY resource.resourcename
ORDER BY 1