Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Join expression not supported" error on JOIN with multiple criteria

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I get an error ("Join expression not supported.") with the following query:

Code:
SELECT DISTINCT [False Positives].[IP Address], Hosts.ipAddressStr, [False Positives].vulnID, VulnsFound.vulnID
FROM ((Jobs INNER JOIN VulnsFound ON Jobs.jobID=VulnsFound.jobID)
  INNER JOIN Hosts ON Hosts.hostID = VulnsFound.hostID)
  LEFT JOIN [False Positives] ON ([False Positives].[IP Address] = Hosts.ipAddressStr AND [False Positives].vulnID = VulnsFound.vulnID)
WHERE Jobs.jobID=348 AND [False Positives].[IP Address] IS NULL
ORDER BY Hosts.ipAddressStr;

I get no error with a simplified query on made-up tables:

Code:
SELECT DISTINCT Omit.IP, Found.IP, Omit.vuln, Found.vuln
FROM Found LEFT JOIN Omit ON Found.vuln=Omit.vuln AND Found.IP=Omit.IP
WHERE Omit.vuln IS NULL
ORDER BY Found.IP;

Can I not LEFT JOIN on x AND y when x and y are in different tables, or am I missing something else? If not, I could use some help with a workaround. :)
 
I discovered my own workaround, which involved using a subquery instead of a left join on [False Positives]:

Code:
... WHERE (jobID=348) AND (VulnsFound.vulnID NOT IN 
(SELECT vulnID FROM [False Positives]
  WHERE [False Positives].[IP Address]=Hosts.ipAddressStr)) ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top