From: | Oliver Elphick <olly(at)lfix(dot)co(dot)uk> |
---|---|
To: | Richard Huxton <dev(at)archonet(dot)com> |
Cc: | 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:32:44 |
Message-ID: | 1046694764.2173.132.camel@linda.lfix.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Mon, 2003-03-03 at 12:09, Richard Huxton wrote:
> 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
The BETWEEN operator is provided for this precise requirement:
SELECT id FROM foo WHERE created_date BETWEEN '2003-01-01' AND '2003-01-07';
--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"A new commandment I give to you, that you love one
another, even as I have loved you."
John 13:34
From | Date | Subject | |
---|---|---|---|
Next Message | Tomasz Myrta | 2003-03-03 12:32:54 | Re: pl/pgsql errors |
Previous Message | Richard Huxton | 2003-03-03 12:09:36 | Re: two dates |