I have a query that returns either 1 or 0, based on whether the event occurred on a given date or not. This is sorted by date. Basically, a simple set of results:
Date | Type --------------------- 2010-09-27 1 2010-10-11 1 2010-11-29 0 2010-12-06 0 2010-12-13 1 2010-12-15 0 2010-12-17 0 2011-01-03 1 2011-01-04 0
What I would like to do now is to count the number of separate, non-matching instances of "0 is," that is, count the number of different groups of 0.
In the above example, the answer should be 3 (1 group of 2, then another group of 2, then finally 1 to finish).
Hopefully the above example illustrates what I'm trying to get to. I have been looking for some time, but it is difficult for me to briefly describe what I am looking for, and therefore have not found anything suitable.
Thanks in advance,
Josh
source share