I'm looking for a way to match a set of results from a larger list of other results, and count the number of matches. For example:
I have a set of results
Result 1
sub1
sub2
sub3
Result 2
sub1
sub2
sub3
I need to find how many times either set of the above results appears in a much larger data set of results below.
Result 1
sub1
sub2
sub3
Result 2
sub1
sub3
sub4
Result 2
sub1
sub2
sub3
Result 2
sub1
sub2
sub3
sub4
In the example above, Result 1 from the first set would match the first result in the second set, and Result 2 would match the final 2 results in the second set, because they contained all the sub results from the first set. So Result 1 would show a frequency count of 1, while Result 2 would show a frequency count of 2.
I'm rather new with SQL, but would like to find a solution to the above problem.
Sample Data from yesterday:
Group Ad Date
A 1 7/14
A 2 7/14
A 3 7/14
B 1 7/14
B 2 7/14
B 3 7/14
B 4 7/14
C 1 7/14
D 1 7/14
D 3 7/14
D 4 7/14
I need to find out how many times Group A Ads 1-3 ran in the past week, but say on Monday Group A ran only ads 1 and 3. I don't want this result returned. Tuesday Group A ran ads 1, 2, 3, 4. I WOULD want to know this result, Wednesday Group A had ads 1, 2, 3 run, this again I would want to know.
Group Ad Date
A 1 7/09
A 3 7/09
A 1 7/10
A 2 7/10
A 3 7/10
A 4 7/10
A 1 7/14
A 2 7/14
A 3 7/14
So, given the example, I would expect to see this:
Group Ad Date
A 1 7/10
A 2 7/10
A 3 7/10
A 1 7/14
A 2 7/14
A 3 7/14