I am not at all conversant in SQL so was hoping someone could help me with a query that will find all the records in a parent table for which there are no records in a child
I simply dont understand whats the having clause doing in your query as I see already you are saying where
ChildTable.ChildField_ = '2131' that already means you have record set for childfield 2131
Try the below query it would mean that if the parent doesnt have child in the Childtable with field 2131then o/p the same.
SELECT ParentTable.ParentID
FROM ParentTable
Where ParentTable.ParentID NOT IN (Select ChildID
From ChildTable where
ChildTable.ChildField_ = '2131')