Re: Count dates distinct within an interval

From: Dmitry Tkach <dmitry(at)openratings(dot)com>
To: greg(at)turnstep(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Count dates distinct within an interval
Date: 2003-07-15 15:00:19
Message-ID: 3F141703.4080904@openratings.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
>
>You need to elaborate on your logic some more, and state exactly what you
>would want in the A,B,C case above. Does B get lumped with A or with C?
>It is within 24 hours of both, after all. Does C not get lumped in with
>B simply because B has already been lumped in with A?
>
Yes. The first (earliest) entry is counted, then all the later ones a
skipped as long as they are within 24 hours from the last one, that's
counted.
In this case, A is counted, B is skipped, because it is within 24 hours
of A, then C is counted, because it is more than 24 hours from A.

Thanks!

Dima

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jean-Luc Lachance 2003-07-15 15:02:17 Re: summing tables
Previous Message Greg Stark 2003-07-15 14:55:38 Re: summing tables