I have 3 tables:
SystemInfo
WorkstationID
WorkstationName
Manufacturer
OS
SoftwareInfo
WorkstationID
SoftwareID
SoftwareList
SoftwareID
SoftwareName
SoftwareVersion
Each workstationID has about 20 SoftwareID rows (Reader, Flash, Java, etc.) I would like the output to look similar to this:
WorkstationID | OS | Manufacturer| Reader Version | Flash Version | Java Version
Desktop01 | W7 | Lenovo | 11.0.7 | 14.X | 8.X
I cannot figure out how to query SoftwareList multiple times and filter each query so that it only returns the SoftwareVersion that is relative to the current WorkstationID.
This is the code I have so far, which won't execute:
select
systeminfo.WorkstationName,
systeminfo.OS,
systeminfo.Manufacturer,
(Select SoftwareList.SoftwareVersion
from systeminfo
join softwareinfo on systeminfo.workstationid = softwareInfo.workstationID
JOIN SoftwareList on softwareinfo.softwareid = softwarelist.softwareid
where SoftwareName = 'Reader'
and softwareinfo.workstationid = systeminfo.workstationid) as "Reader"
from
systeminfo
join softwareinfo on systeminfo.workstationid = softwareInfo.workstationID
JOIN SoftwareList on softwareinfo.softwareid = softwarelist.softwareid