Re: two dates

From: Richard Huxton <dev(at)archonet(dot)com>
To: mixo <mixo(at)beth(dot)uniforum(dot)org(dot)za>, pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: two dates
Date: 2003-03-03 12:09:36
Message-ID: 200303031209.36970.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Oliver Elphick 2003-03-03 12:32:44 Re: two dates
Previous Message Achilleus Mantzios 2003-03-03 12:01:17 Re: Dynamic SELECT condition