pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: mixo <mixo@beth.uniforum.org.za>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: two dates
Date: Mon, 3 Mar 2003 12:09:36 +0000
Message-ID: <200303031209.36970.dev@archonet.com> (raw)
In-Reply-To: <3E5B1349.80705@beth.uniforum.org.za>
References: <3E5B1349.80705@beth.uniforum.org.za>

On Tuesday 25 Feb 2003 6:55 am, mixo wrote:
> I have a table which has serveral time stamps include when an entry was
> 'created'.
> Each entry is identified by a unique 'id'. How can I best find entries
> created
> between two dates without going through each day between the two dates?
>
> Currently, going through each day to get the results takes about 23
> minutes for 7 days
> as I have two other criteria for search: roughly I am doing about
> 16*17*n queries,
> where n=days between two dates (for 7 days, 16*17*7 = which a number
> that is
> too big for my liking).

What is wrong with SELECT id FROM foo WHERE created_date>='2003-01-01' AND 
created_date<='2003-01-07' or similar? I don't see why you need multiple 
queries, perhaps I have misunderstood

-- 
  Richard Huxton



view thread (4+ messages)  latest in thread

Message-ID: <200303031209.36970.dev@archonet.com>
Permalink:  ../200303031209.36970.dev@archonet.com/
Also on:    postgresql.org/message-id/200303031209.36970.dev@archonet.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: dev@archonet.com, mixo@beth.uniforum.org.za
  Subject: Re: two dates
  In-Reply-To: <200303031209.36970.dev@archonet.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