QUERY: SELECT p.*, pc.*, pv.PolicyVersionID, pv.HighestVersionNumber,pv.HighestVersionFileName, pv.HighestVersionApproveDate, pv.VersionFileName FROM (SELECT *, max(VersionNumber) AS HighestVersionNumber, max(VersionFileName) AS HighestVersionFileName, max(VersionApproveDate) AS HighestVersionApproveDate FROM Policy_Versions GROUP BY PolicyID ) AS pv JOIN Policies p ON p.PolicyID = pv.PolicyID JOIN Policy_Categories pc ON pc.PolicyCatID = p.CategoryID WHERE 1=1 AND p.PolicyID IN (7,41,19,75,26,58) AND PolicyID IN (7,41,19,75,26,58) ORDER BY p.PolicyName
ERROR: Column 'PolicyID' in where clause is ambiguous