How can I filter a nested repeating record when using an aggregation function and WITHIN clause?
For example: I have a scheme where each record represents a person and each person has a nested childrens record. For each child I have name and age.
I can easily count the children for each person by using COUNT(children.name) WITHIN RECORD, but what if I want to count only the children with age>18?