From: bartschm@psi.com
To: Postgres SQL list <pgsql-sql@postgresql.org>
Subject: Re: how to select a time frame on timestamp rows.
Date: Sat, 13 Jan 2001 22:40:51 -0300
Message-ID: <3A6103A3.135E5E8E@psi.com> (raw)
References: <Pine.LNX.4.30.0101140208531.965-100000@peter.localdomain>
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/
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: bartschm@psi.com
Subject: Re: how to select a time frame on timestamp rows.
In-Reply-To: <3A6103A3.135E5E8E@psi.com>
References: <Pine.LNX.4.30.0101140208531.965-100000@peter.localdomain> <3A6103A3.135E5E8E@psi.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