Distinct count on a rolling time window
问题 I want to count the number of distinct catalog numbers that have appeared within the last X minutes. This is usually called a rolling time window. For instance, if I have: row startime orderNumber catalogNumb 1 2007-09-24-15.50 o1 21 2 2007-09-24-15.51 o2 21 3 2007-09-24-15.52 o2 21 4 2007-09-24-15.53 o3 21 5 2007-09-24-15.54 o4 22 6 2007-09-24-15.55 o4 23 7 2007-09-24-15.56 o4 21 8 2007-09-24-15.57 o4 21 For instance, if I want to get this for the last 5 minutes (5 is just one of the