pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: greg@turnstep.com
To: pgsql-sql@postgresql.org
Cc: dmitry@openratings.com
Subject: Re: Count dates distinct within an interval
Date: Tue, 15 Jul 2003 14:54:41 -0000
Message-ID: <7f2298d39c75726c835ecbf42f0c8e70@biglumber.com> (raw)
In-Reply-To: <3F1410CB.9020504@openratings.com>


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



> Now, I want to count the occurences of each value of stuff in the table, 
> but so that entries within 24 hours from each other count as one...
>...
> A = 2001 - 01- 01 20:20:00
> B = 2001 - 01 - 02 20:19:00
> C = 2001 - 01 - 02 20:21:00
> Should be counted as *two* (A === B, and B === C, but *not* A === C)...

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?

Perhaps showing us the sample output of an ideal query would be best, 
along with some sample rows (e.g. use real insert statements)


- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200307151045
-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE/FBS9vJuQZxSWSsgRAnk3AJ0bqyDk6iZWqSZuHfZslFCjxwl7fgCfaZ7r
XdwpPsO4OaTa9YpjmXx1hmA=
=IFRz
-----END PGP SIGNATURE-----






view thread (5+ messages)  latest in thread

Message-ID: <7f2298d39c75726c835ecbf42f0c8e70@biglumber.com>
Permalink:  ../7f2298d39c75726c835ecbf42f0c8e70@biglumber.com/
Also on:    postgresql.org/message-id/7f2298d39c75726c835ecbf42f0c8e70@biglumber.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: greg@turnstep.com, dmitry@openratings.com
  Subject: Re: Count dates distinct within an interval
  In-Reply-To: <7f2298d39c75726c835ecbf42f0c8e70@biglumber.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox