I'm not exactly sure how to frame this question in query terms so I'm struggling to even do a proper Google search, but I suspect someone here could be enormously helpful.
Suppose I have two tables with a parent/child relationship, and what I need to be able to identify are the distinct child row sets that exist in the data. For example:
1, 'Set 1' | 2, 'Set 2' | 3, 'Set 3' | 4, 'Set 4'
[ID] [ParentID] [Letter]
1, 1, 'A' | 2, 1, 'B' | 3, 1, 'C' | 4, 2, 'A' | 5, 2, 'B' | 6, 2, 'C' | 7, 2, 'D' | 8, 2, 'E' | 9, 3, 'A' | 10, 3, 'B'| 11, 4, 'A' | 12, 4, 'B'
So from these 3 parent rows and 10 child rows, we can determine that there are three distinct sets of letters, [A, B, C], [A, B, C, D, E], and [A, B].
So assuming I had dozens of parent rows and hundreds of child rows of data with numerous duplicate sets, how would I construct a query that would give a summary showing the distinct sets of letters and how many of each?
[A, B, C] - 41
[A, B, C, D, E] - 32
[A, B] - 87