Re: how to select a time frame on timestamp rows. - Mailing list pgsql-sql

From bartschm@psi.com
Subject Re: how to select a time frame on timestamp rows.
Date
Msg-id 3A6103A3.135E5E8E@psi.com
Whole thread Raw
In response to Re: how to select a time frame on timestamp rows.  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-sql
Peter Eisentraut wrote:
Thanks Peter for the answer, so i assume i can also do
select user_name from tbacct where extract(month from acct_timestamp) =
11 and extract(year from acct_timestamp) = 2000 ...


> 
> bartschm@psi.com writes:
> 
> >       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,
> > is there any other way to doit, or is this the pgsql way?  , actually
> > i'm using a query like this:
> > select User_Name from tbacct where acct_timestamp like '2000-11%' group
> > by User_Name;
> 
> select user_name from tbacct where extract(month from acct_timestamp) = 11 ...
> 
> (SQL compliant)
> 
> --
> Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


pgsql-sql by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: how to select a time frame on timestamp rows.
Next
From: Alvar Freude
Date:
Subject: Using INDEX on date/time values // Re: how to select a time frame on timestamp rows.