I want to count a list of entries in my database that all have specified relationships to one person, but I need to count by their relationship to each other - in other words, they are listed as sons and daughters, brothers and sisters of the main person in the house - I need to count the number of siblings.
My approach was to try to count all the households with more than one son or daughter or any household with a son and a daughter or any household with a brother and a sister, more than one brother or more than one sister. However when I try to put this into SQL I'm not getting anywhere.
SELECT FirstName, Surname
FROM individuals
WHERE (RelationshipToHead = 'Son' AND RelationshipToHead = 'Daughter')
OR (RelationshipToHead = 'Son' AND RelationshipToHead = 'Son')
OR (RelationshipToHead = 'Daughter' AND RelationshipToHead = 'Daughter')
OR (RelationshipToHead = 'Brother' AND RelationshipToHead = 'Sister')
OR (RelationshipToHead = 'Sister' AND RelationshipToHead = 'Sister')
OR (RelationshipToHead = 'Brother' AND RelationshipToHead = 'Brother')
This merely returns all entries that contain son daughter brother or sister - not the ones with more than one of each in each family.
Could you suggest a better query?