SELECT P.*
FROM BPS_Patients as P
LEFT JOIN REACTIONS AS R
ON R.INTERNALID = p.InternalID
INNER JOIN CLINICAL AS C
ON C.INTERNALID = P.InternalID
WHERE P.StatusText = 'Active'
AND C.KNOWNALLERGIES = 1
AND R.RECORDID IS NULL
ORDER BY surname, firstname

-- Patients with no known allergies