The following sample query demonstrates how to join asset intelligence views to asset intelligence hardware inventory and discovery views. Most often, the asset intelligence hardware inventory views will be used when creating asset intelligence reports for resources and joined to other views by using the ResourceID column. The asset intelligence views can be joined to the asset intelligence hardware inventory views to list product information by using the SoftwareCode column.
This sample query lists the publisher, product, installation date, and installation path for software identified during a hardware inventory on the Workstation1 computer. The query results are sorted by the latest installation date and then product name. The query joins the v_GS_INSTALLED_SOFTWARE asset intelligence hardware inventory view to the v_LU_SoftwareList_Editable asset intelligence view by using the SoftwareCode0 and SoftwareCode columns, respectively, and it joins the v_GS_INSTALLED_SOFTWARE view with the v_R_System discovery view by using the ResourceID column. A LEFT OUTER JOIN is used when joining the views to display only information contained in the v_GS_INSTALLED_SOFTWARE view.
SELECT v_LU_SoftwareList_Editable.CommonPublisher AS
FROM v_GS_INSTALLED_SOFTWARE LEFT OUTER JOIN
LEFT OUTER JOIN v_R_System ON
WHERE (v_R_System.Netbios_Name0 LIKE
ORDER BY [Install Date] DESC, [Product Name]