Hello. I need help with a SQL query I'm trying to run in LS.
End goal: we want to find all machines with Java installed, but NOT include anything that has the SE Development Kit OR a software known as "Ignition". [Has: Java but NOT (SE Development Kit OR Ignition)]
Here's the query as it stands:
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysOS.OSname As OS,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
'black' As foregroundcolor,
tblComputersystem.Domainrole
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Where tblAssets.AssetID In (Select Top 1000000 tblSoftware.AssetID
From tblSoftware Inner Join tblSoftwareUni On tblSoftwareUni.SoftID =
tblSoftware.softID
Where tblSoftwareUni.softwareName Like 'Java%' And
Not (tblSoftwareUni.softwareName Like '%SE Development Kit%' Or
tblSoftwareUni.softwareName Like 'Ignition%')) And tblAssetCustom.State =
1 And tblComputersystem.domainrole = 1
Order By tblAssets.Domain,
tblAssets.AssetName
TIA