Use Case: get all accounts that don't have a related attachment I have used this query but I get an error when I add the Bold part
SELECT Id, (SELECT Id, StageName FROM Opportunities WHERE StageName = 'Closed Won'),(SELECT Title,ParentId FROM CombinedAttachments) FROM Account Where Id IN (SELECT AccountId FROM Opportunity WHERE StageName = 'Closed Won') AND ID NOT IN (SELECT ParentId FROM CombinedAttachments)
The bold part below throws the error shown in the image below
AND ID NOT IN (SELECT ParentId FROM CombinedAttachments)
ID IN NOT
instead ofNOT IN
. I'm not sure if this is what caused the error though.