We have a dataset that looks like this:
ID eventType date
--------------------------------
1 foo 2 March 2013
2 foo 3 March 2013
3 bar 3 March 2013
4 foo 5 March 2013
5 foo 6 March 2013
6 bar 7 March 2013
7 baz 8 March 2013
I can easily get the unique list of eventTypes
from this list. However, how do I query the count of which eventTypes
first appeared BETWEEN startDate
and endDate
. I want to be able to have a date range from 7 March 2013 - 10 March 2013 and get a count returned of 1 since baz
value was a newly occurring eventType
during the date range. On the other hand, a date range of 5 March 2013 - 7 March 2013 would return a count of 0 since no newly occurring eventTypes
appeared in that range.