Re: Using INDEX on date/time values // Re: how to select a time frame on timestamp rows. - Mailing list pgsql-sql

From Mike Castle
Subject Re: Using INDEX on date/time values // Re: how to select a time frame on timestamp rows.
Date
Msg-id 20010114175133.C3604@thune.yy.com
Whole thread Raw
In response to Using INDEX on date/time values // Re: how to select a time frame on timestamp rows.  (Alvar Freude <alvar.freude@merz-akademie.de>)
List pgsql-sql
On Sun, Jan 14, 2001 at 04:46:08AM +0100, Alvar Freude wrote:
> Peter Eisentraut schrieb:
> > 
> > >       today i was trying to perform a query on a database using a time stamp
> > > field, i need to get all records which belong to year 2000, month 11,
> [...]
> > select user_name from tbacct where extract(month from acct_timestamp) = 11 ...
> 
> is there any way of using an index for selecting some rows, e.g.
> selecting all data from one month?


What about select blah from foo where month >= 2000-11-01 and month < 2000-12-01

Fix up as appropriate.

mrc
--       Mike Castle       Life is like a clock:  You can work constantly dalgoda@ix.netcom.com  and be right all the
time,or not work at all
 
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc   We are all of us living in the shadow of
Manhattan. -- Watchmen
 


pgsql-sql by date:

Previous
From: Thomas Swan
Date:
Subject: Re: Serials
Next
From: Markus Wagner
Date:
Subject: using pg as a db backend in Access